Class MultiBitNums

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.

Function overview

Integer encoding/decoding (so far only decoding has been implemented):

Class Methods

MultiBitNums.new( str, nbit [, nint] )

Creates a new object from a binary data (string) containing multi-bit segments.

ARGUMENTS

RETURN VALUE

ERRORS

Instance Methods

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