DEFLATE
DEFLATE is a lossless compressed-data format combining length-distance references and Huffman coding, with an additional uncompressed block form.
Compressed blocks use fixed or dynamic Huffman codes; stored blocks carry uncompressed bytes. Match lengths are 3-258 bytes and backward distances are 1-32768 bytes. The distance limit bounds history, not stream length. Only stored blocks have a 65535-byte data limit. [1]
Raw DEFLATE has no wrapper payload checksum. The zlib format adds Adler-32 and can identify a preset dictionary; gzip adds a member header, CRC32 and uncompressed size modulo 2^32. These formats are not interchangeable decoder inputs. [2] [3]
A match can overlap the output it creates. A length 5 at distance 2 after XY appends XYXYX. Decoding therefore needs evolving history, not just a frozen copy of earlier bytes. [1]
Relations
Limitations
- Huffman coding is block-local, but references can cross block boundaries; locating a block does not guarantee independent decoding. [1]
- A wrapper checksum can detect corruption only when checked; RFC 1952 permits a compliant gzip decoder to skip its trailer. It does not authenticate the archive. [2] [3]
Citations
- RFC 1951: DEFLATE format, sections 2 and 3.2-3.3 (Informational, May 1996)
- RFC 1950: zlib wrapper, dictionary identifier and Adler-32, section 2.2
- RFC 1952: gzip member header and trailer, section 2.3.1
Further reading
Sources & caveats
- Primary-format synthesis, not a performance benchmark or a historical claim about first implementation. RFC 1951 is Informational.