Return the uncompressed contents of binary string string, which must
have been in gzip format. If -headerVar is given, store a dictionary
describing the contents of the gzip header in the variable called
varName. The keys of the dictionary that may be present are:

Return the compressed contents of binary string string in gzip format.
If -level is given, level gives the compression level to use
(from 0, which is uncompressed, to 9, maximally compressed). If -header
is given, dict is a dictionary containing values used for the gzip
header. The following keys may be defined:

Pushes a compressing or decompressing transformation onto the channel
channel.
The transformation can be removed again with chan pop.
The mode argument determines what type of transformation
is pushed; the following are supported:

Sets the compression dictionary to use when working with compressing or
decompressing the data to be binData. Not valid for transformations that
work with gzip-format data. The dictionary should consist of strings (byte
sequences) that are likely to be encountered later in the data to be compressed,
with the most commonly used strings preferably put towards the end of the
dictionary. Tcl provides no mechanism for choosing a good such dictionary for
a particular data sequence.

The maximum number of bytes ahead to read when decompressing. This defaults to
1, which ensures that data is always decompressed correctly, but may be
increased to improve performance. This is more useful when the channel is
non-blocking.

Both compressing and decompressing channel transformations add extra
configuration options that may be accessed through chan configure. The
options are:

This read-only option gets the current checksum for the uncompressed data that
the compression engine has seen so far. It is valid for both compressing and
decompressing transforms, but not for the raw inflate and deflate formats. The
compression algorithm depends on what format is being produced or consumed.

This read-write options gets or sets the initial compression dictionary to use
when working with compressing or decompressing the data to be binData.
It is not valid for transformations that work with gzip-format data, and should
not normally be set on compressing transformations other than at the point where
the transformation is stacked. Note that this cannot be used to get the
current active compression dictionary mid-stream, as that information is not
exposed by the underlying library.

This write-only operation flushes the current state of the compressor to the
underlying channel. It is only valid for compressing transformations. The
type must be either sync or full for a normal flush or an
expensive flush respectively. Flushing degrades the compression ratio, but
makes it easier for a decompressor to recover more of the file in the case of
data corruption.

This read-write option is used by decompressing channels to control the
maximum number of bytes ahead to read from the underlying data source. This
defaults to 1, which ensures that data is always decompressed correctly, but
may be increased to improve performance. This is more useful when the channel
is non-blocking.

Creates a streaming compression or decompression command based on the
mode, and return the name of the command. For a description of how that
command works, see STREAMING INSTANCE COMMAND below. The following modes
and options are supported:

The stream will be a compressing stream that produces zlib-format output,
using compression level level (if specified) which will be an integer
from 0 to 9,
and the compression dictionary bindata (if specified).

The stream will be a compressing stream that produces raw output, using
compression level level (if specified) which will be an integer from 0
to 9,
and the compression dictionary bindata (if specified). Note that
the raw compressed data includes no metadata about what compression
dictionary was used, if any; that is a feature of the zlib-format data.

The stream will be a compressing stream that produces gzip-format output,
using compression level level (if specified) which will be an integer
from 0 to 9, and the header descriptor dictionary header (if specified;
for keys see zlib gzip).

The stream will be a decompressing stream that takes raw compressed input and
produces uncompressed output.
If bindata is supplied, it is a compression dictionary to use. Note that
there are no checks in place to determine whether the compression dictionary
is correct.

Streaming compression instance commands are produced by the zlib stream
command. They are used by calling their put subcommand one or more times
to load data in, and their get subcommand one or more times to extract
the transformed data.

The full set of subcommands supported by a streaming instance command,
stream, is as follows:

Return up to count bytes from stream's internal buffers with the
transformation applied. If count is omitted, the entire contents of the
buffers are returned.
stream header
Return the gzip header description dictionary extracted from the stream. Only
supported for streams created with their mode parameter set to
gunzip.

Append the contents of the binary string data to stream's internal
buffers while applying the transformation. The following options are
supported (or an unambiguous prefix of them), which are used to modify the
way in which the transformation is applied:

Mark the stream as finished, ensuring that all bytes have been wholly
compressed or decompressed. For gzip streams, this also ensures that the
footer is written to the stream. The stream will need to be reset before
having more data written to it after this, though data can still be read out
of the stream with the get subcommand.

This option is mutually exclusive with the -flush and -fullflush
options.

Ensure that not only can a decompressor handle all the bytes produced so far
(as with -flush above) but also that it can restart from this point if
it detects that the stream is partially corrupt. This incurs a substantial
performance penalty.

This option is mutually exclusive with the -finalize and -flush
options.