Here I explore, for self-educational purposes, popular binary file formats. I also explore expressiveness of functional programming in implementing codecs for reading and writing those data formats. Implemented codecs are not optimized for speed.
Only GZIP decoder has been implemented so far.
Following documents specify GZIP file format:
An example .gz file has been manually crafted and placed in examples
directory (abc.gz
). The file demonstrates use of
all three types of blocks in DEFLATE data format: non-compressed, compressed with fixed Huffman codes, and compressed
with dynamic Huffman codes. Boundaries between these blocks can be found with the help of DeflateDecoder.log
method.
$ sbt "run examples/abc.gz"