lib/bindata/io.rb
# Reads exactly +nbits+ bits from the stream. +endian+ specifies whether
# the bits are stored in +:big+ or +:little+ endian format.
Reads exactly +nbits+ bits from the stream.
Reads exactly + nbits + bits from the stream .
def readbits(nbits, endian = :big)
      if @rendian != endian
        @rnbits  = 0
        @rval    = 0
        @rendian = endian
      end
      if endian == :big
        read_be_bits(nbits)
      else
        read_le_bits(nbits)
      end
    end
def readbits ( nbits , endian = :big ) if @rendian != endian @rnbits = 0 @rval = 0 @rendian = endian end if endian == :big read_be_bits ( nbits ) else read_le_bits ( nbits ) end end
Reads exactly +nbits+ bits from the stream.
Reads exactly + nbits + bits from the stream .
# don't mix bits of differing endian
nbits
<not_specific>
endian
<not_specific>