Skip to content

mpod/scala-codecs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scala-codecs

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.

GZIP decoder

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.

Running

$ sbt "run examples/abc.gz"