Search code examples
huffman-codedeflate

Examples of Deflate Compression


I am interested in learning about the deflate compression algorithm, particularly how is it represented in a data-stream, and feel that I would greatly benefit from some extra examples (eg. the compression of a short string of text, or the decompression of a compressed chunk). I am continuing to study some resources I have found: ref1, ref2, ref3 but these do not have many examples of how the actual compression looks as a data-stream.

If I could get a few examples of how some strings would look before and after being compressed, and an explanation of the relationship between them that would be fantastic.

Also if there are other resources that I could be looking at please add those.


Solution

  • You can compress example data with gzip or zlib and use infgen to disassemble and examine the resulting compressed data. infgen also has an option to see the detail in the dynamic headers.