Class: BinData::BitAligned::BitAlignedIO
- Inherits:
-
Object
- Object
- BinData::BitAligned::BitAlignedIO
- Defined in:
- lib/bindata/alignment.rb
Instance Method Summary collapse
-
#initialize(io) ⇒ BitAlignedIO
constructor
A new instance of BitAlignedIO.
- #readbytes(n) ⇒ Object
Constructor Details
#initialize(io) ⇒ BitAlignedIO
Returns a new instance of BitAlignedIO.
45 46 47 |
# File 'lib/bindata/alignment.rb', line 45 def initialize(io) @io = io end |
Instance Method Details
#readbytes(n) ⇒ Object
48 49 50 51 52 |
# File 'lib/bindata/alignment.rb', line 48 def readbytes(n) n.times.inject("") do |bytes, _| bytes += @io.readbits(8, :big).chr end end |