using (GZipStream output = new GZipStream(destinationFile,
CompressionMode.Compress))
{
Console.WriteLine("Compressing {0} to {1}.", sourceFile.Name,
destinationFile.Name, false);
output.Write(buffer, 0, buffer.Length);
}
Although this will not cause any compiling error or runtime error, but i guess the 'false' was writing the wrong place. Should be as follow:
using (GZipStream output = new GZipStream(destinationFile,
CompressionMode.Compress, false))
{
Console.WriteLine("Compressing {0} to {1}.", sourceFile.Name,
destinationFile.Name);
output.Write(buffer, 0, buffer.Length);
}