Stream Format
A Deflate stream consists of a series of blocks. Each block is preceded by a 3-bit header:
- 1 bit: Last-block-in-stream marker:
1: this is the last block in the stream.0: there are more blocks to process after this one.
- 2 bits: Encoding method used for this block type:
00: a stored/raw/literal section, between 0 and 65,535 bytes in length.01: a static Huffman compressed block, using a pre-agreed Huffman tree.10: a compressed block complete with the Huffman table supplied.11: reserved, don't use.
Most blocks will end up being encoded using method 10, the dynamic Huffman encoding, which produces an optimised Huffman tree customised for each block of data individually. Instructions to generate the necessary Huffman tree immediately follow the block header.
Compression is achieved through two steps
- The matching and replacement of duplicate strings with pointers.
- Replacing symbols with new, weighted symbols based on frequency of use.
Read more about this topic: DEFLATE
Famous quotes containing the word stream:
“To me heaven would be a big bull ring with me holding two barrera seats and a trout stream outside that no one else was allowed to fish in and two lovely houses in the town; one where I would have my wife and children and be monogamous and love them truly and well and the other where I would have my nine beautiful mistresses on nine different floors.”
—Ernest Hemingway (18991961)