From be3cf68c86bb143e27c4c79a5e4b7792809cb840 Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 19 Apr 2015 15:23:15 +0400 Subject: [PATCH] use 'zlib' compression method instead of 'deflate'. --- deflate.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/deflate.cs b/deflate.cs index 533ac726..366c398b 100644 --- a/deflate.cs +++ b/deflate.cs @@ -12,13 +12,16 @@ class Inflate public static void Main (string[] args) { if (args.Length != 2) + { + Console.WriteLine ("Usage: deflate INPUT-FILE OUTPUT-FILE"); return; + } try { using (var input = File.Open (args[0], FileMode.Open, FileAccess.Read)) - using (var output = File.Create (args[1])) - using (var stream = new DeflateStream (output, CompressionMode.Compress, CompressionLevel.Level5)) - input.CopyTo (stream); + using (var output = File.Create (args[1])) + using (var stream = new ZLibStream (output, CompressionMode.Compress, CompressionLevel.Level9)) + input.CopyTo (stream); Console.WriteLine ("{0} => {1}", args[0], args[1]); } catch (Exception X)