1 Introduction

This library is an implementation of Deflate (RFC 1951) decompression,
with optional support for ZLIB-style (RFC 1950) and gzip-style
(RFC 1952) wrappers of deflate streams. It currently does not handle
compression, although this is a natural extension.

The implementation should be portable across all ANSI compliant CL
implementations, but has been optimized mostly for SBCL and CMU CL
(and other implementations that can generate fast code for word-sized
integer calculations based on standard type declarations), and
somewhat (mostly the otherwise very expensive CRC-32 calculations) for
Lispworks. The performance is still a bit off from zlib/gzip (by a
factor of around 3-3.5 on my systems), and while much of the
performance loss is likely to be in the stream-based I/O, a less naive
implementation of the huffman decoding step is also likely to benefit
performance a bit.

The implementation is licensed under the MIT-style license contained
in the file COPYING and the header of each source file.

Please direct any feedback to pmai@pmsf.de. A git repository of this
library is available under http://github.com/pmai/Deflate/tree/master

5.1.1 Functions

Inflate the RFC 1952 gzip data from the given input stream into
the given output stream, which are required to have an element-type
of (unsigned-byte 8). This returns the CRC-32 checksum of the
file as its first return value, with any filename, modification time,
and comment fields as further return values or nil if not present.
Note that it is the responsibility of the caller to check whether the
expanded data matches the CRC-32 checksum, unless the check-checksum
keyword argument is set to true, in which case the checksum is checked
internally and a gzip-decompression-error is signalled if they don’t
match.

Inflate the RFC 1951 data from the given input stream into the
given output stream, which are required to have an element-type
of (unsigned-byte 8). If checksum is given, it indicates the
checksumming algorithm to employ in calculating a checksum of
the expanded content, which is then returned from this function.
Valid values are :adler-32 for Adler-32 checksum (see RFC 1950),
or :crc-32 for CRC-32 as per ISO 3309 (see RFC 1952, ZIP).

Inflate the RFC 1950 zlib data from the given input stream into
the given output stream, which are required to have an element-type
of (unsigned-byte 8). This returns the Adler-32 checksum of the
file as its first return value, with the compression level as its
second return value. Note that it is the responsibility of the
caller to check whether the expanded data matches the Adler-32
checksum, unless the check-checksum keyword argument is set to
true, in which case the checksum is checked internally and a
zlib-decompression-error is signalled if they don’t match.

Parse a GZIP-style header as per RFC 1952 from the input-stream and
return the compression-method, text-flag, modification time, XFLAGS,
OS, FEXTRA flags, filename, comment and CRC16 fields of the header as
return values (or nil if any given field is not present). Checks the
header for magic values and correct flags settings and signals a
gzip-decompression-error in case of incorrect or unsupported magic
values or flags.

Parse a ZLIB-style header as per RFC 1950 from the input-stream and
return the compression-method, compression-level dictionary-id and flags
fields of the header as return values. Checks the header for corruption
and signals a zlib-decompression-error in case of corruption.