[]
ZStream is the most flexible and hardest to use class in the C1.C1Zip assembly. It contains a C# implementation of ZLIB's zstream object, which is a general purpose compressor and decompressor.
public class ZStream
In most cases, you should be able to use the C1ZStreamReader and C1ZStreamWriter classes instead of ZStream. These classes provide friendly and easy-to-use wrappers that hide the ZLIB complexity.
Use ZStream only if you are familiar with ZLIB and need control over the low-level aspects of the data compression or decompression process (e.g., to provide your own buffers or compression dictionaries).
If you choose to use ZStream directly and need technical support, please check out the detailed documentation, sample, and articles available at http://www.info-zip.org/ or http://www.gzip.org/, the official zlib sites.
ZLIB is an open-source, patent-free library created by Jean-Loup Gailly and Mark Adler.
Name | Description |
---|---|
ZStream() | Initializes a new instance of the ZStream class using an Adler checksum. |
ZStream(bool) | Initializes a new instance of the ZStream class. |
Name | Description |
---|---|
Z_BUF_ERROR | No progress possible or no room in output buffer. |
Z_DATA_ERROR | Input data is corrupted (wrong format or checksum). |
Z_ERRNO | File error. |
Z_MEM_ERROR | Not enough memory. |
Z_NEED_DICT | A preset dictionary is needed at this point. |
Z_OK | No error. |
Z_STREAM_END | End of stream detected. |
Z_STREAM_ERROR | Stream structure is inconsistent (input/output buffers are null for example). |
Z_VERSION_ERROR | Incompatible ZLIB version. |
adler | Current checksum value (Adler or CRC32). |
avail_in | Number of bytes available in the input buffer. |
avail_out | Number of free bytes remaining in output buffer. |
msg | Description of the last error (null if no errors). |
next_in | Input buffer. |
next_in_index | Position of cursor into input buffer. |
next_out | Output buffer. |
next_out_index | Position of cursor into the output buffer. |
total_in | Total number of input bytes read so far. |
total_out | Total number of bytes output so far. |
Name | Description |
---|---|
deflate(int) | Compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. |
deflateEnd() | Frees all dynamically allocated data structures for this stream, discards any unprocessed input, and does not flush any pending output. |
deflateInit(int) | Initializes the internal stream state for compression. |
deflateInit(int, int) | Initializes the internal stream state for compression. |
deflateParams(int, int) | Dynamically updates the compression level and compression strategy. |
deflateSetDictionary(byte[], int) | Initializes the compression dictionary from the given byte sequence without producing any compressed output. |
inflate(int) | Decompresses as much data as possible until the input buffer is exhausted or the output buffer is full. |
inflateEnd() | Frees all dynamically allocated data structures for this stream, discards any unprocessed input, and does not flush any pending output. |
inflateInit() | Initializes the internal stream state for decompression. |
inflateInit(int) | Initializes the internal stream state for decompression. |
inflateSetDictionary(byte[], int) | Initializes the decompression dictionary from the given uncompressed byte sequence. |
inflateSync() | Skips invalid compressed data until a full flush point is found, or until all available input is skipped. No output is provided. |