The GZipStream
is a
Like the System.IO.Compression.GZipStream
in the .NET Base Class Library, the Ionic.Zlib.GZipStream
can compress while writing, or decompress while reading, but not vice versa. The compression method used is GZIP, which is documented in
A GZipStream
can be used to decompress data (through Read()
) or to compress data (through Write()
), but not both.
If you wish to use the GZipStream
to compress data, you must wrap it around a write-able stream. As you call Write()
on the GZipStream
, the data will be compressed into the GZIP format. If you want to decompress data, you must wrap the GZipStream
around a readable stream that contains an IETF RFC 1952-compliant stream. The data will be decompressed as you call Read()
on the GZipStream
.
Though the GZIP format allows data from multiple files to be concatenated together, this stream handles only a single segment of GZIP format, typically representing a single file.
This class is similar to ZlibStream and DeflateStream. ZlibStream
handles RFC1950-compliant streams. DeflateStream handles RFC1951-compliant streams. This class handles RFC1952-compliant streams.