Stefan Rusterholz wrote:
> Since it came up here and is somewhat related: I recently wrote out of 
> fun some wrapper methods to make it a bit nicer to read/write binary 
> datastructures. IMHO it's a bit cumbersome to do things like:
> size = socket.read(4).unpack("I").first
> meta = SomeStruct.new(*socket.read(x).unpack(format))
> data = socket.read(size)

See also:

binaryparse
bindata
bitstruct

The first two are gems, the last is tgz, available at 
http://redshift.sourceforge.net/bit-struct (that one's mine).

-- 
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407