BinData provides a declarative way to read and write structured binary
data. This means the programmer specifies what the format of the
binary data is, and BinData works out how to read and write data in
this format. It is an easier (and more readable) alternative to ruby's
#pack and #unpack methods. BinData makes it easy to create new data
types. It supports all the common primitive datatypes that are found
in structured binary data formats. Support for dependent and variable
length fields is built in.

Homepage:
https://github.com/dmendel/bindata
