Provides methods and properties for compressing and decompressing streams by using the Deflate algorithm.
See Also: DeflateStream Members
This class represents the Deflate algorithm, which is an industry-standard algorithm for lossless file compression and decompression. Starting with the net_v45, the System.IO.Compression.DeflateStream class uses the zlib library. As a result, it provides a better compression algorithm and, in most cases, a smaller compressed file than it provides in earlier versions of the .NET Framework.
This class does not inherently provide functionality for adding files to or extracting files from zip archives. To work with zip archives, use the System.IO.Compression.ZipArchive and the System.IO.Compression.ZipArchiveEntry classes.
The compression functionality in System.IO.Compression.DeflateStream and System.IO.Compression.GZipStream is exposed as a stream. Data is read on a byte-by-byte basis, so it is not possible to perform multiple passes to determine the best method for compressing entire files or large blocks of data. The System.IO.Compression.DeflateStream and System.IO.Compression.GZipStream classes are best used on uncompressed sources of data. If the source data is already compressed, using these classes may actually increase the size of the stream.