Compression Sample
The System.IO.Compression namespace provides the functionality to add compression capabilities to your code
by using the GZipStream and Deflate Stream classes. These classes allow you to compress and decompress files
in the GZip format.
In this example we create a simple zip utility class that provides the functionality to compress and decompress
a single file. The CompressFile method reads in the source file, and then uses the GZipStream to compress the data
before writing the compressed stream to another file stream. The DecompressFile method follows the same path, except
that the size of the uncompressed destination stream has to be derived from the compressed data stream first.
This sample requires the following to be installed: