Class of multiple multi-bit data packed in a C string. The number of bits is fixed to an arbitrary value. For example, it can accommodate 11-bit integers.
Integer encoding/decoding (so far only decoding has been implemented):
MultiBitNums.new( str, nbit [, nint] )
Creates a new object from a binary data (string) containing multi-bit segments.
ARGUMENTS
RETURN VALUE
ERRORS
to_int32str
Converts into a string containing binary data of 32-bit integers of the system. Useful with NArray.
ARGUMENTS
(none)
RETURN VALUE
ERRORS
EXAMPLE
mb = MultiBitNums.new(str, nbits) require "narray" # download it from RAA at www.ruby-lang.org ary = NArray.to_na( mb, "int" ) # the data is read into a NArray ary