By year

  1. 2018 (2)
  2. 2017 (4)
  3. 2015 (9)

Example of read_until parameter of BinData::Array

Ruby Snippet BinData

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