Posted on Aug 5
BinData is a Ruby Gem that can be used to parse and write binary data in a declarative way. Unlike structs in C language, which can only define static binary structures where sizes of fields are fixed, BinData provides a way to define a variable sized array by supplying a dynamic initial_length
or read_until
parameter.
Both the parameters are well described with examples in the BinData manual.
Here is an example of read_until
parameter that contains references to external parameters.
This example is meant to show how the propagation of method resolution works.
2015 My gh-pages