Module: BinData::BitAligned
- Defined in:
- lib/bindata/alignment.rb
Overview
Defined Under Namespace
Classes: BitAlignedIO
Instance Method Summary collapse
- #bit_aligned? ⇒ Boolean
- #do_num_bytes ⇒ Object
- #do_write(io) ⇒ Object
- #read_and_return_value(io) ⇒ Object
Instance Method Details
#bit_aligned? ⇒ Boolean
55 56 57 |
# File 'lib/bindata/alignment.rb', line 55 def bit_aligned? true end |
#do_num_bytes ⇒ Object
63 64 65 |
# File 'lib/bindata/alignment.rb', line 63 def do_num_bytes super.to_f end |
#do_write(io) ⇒ Object
67 68 69 |
# File 'lib/bindata/alignment.rb', line 67 def do_write(io) value_to_binary_string(_value).each_byte { |v| io.writebits(v, 8, :big) } end |
#read_and_return_value(io) ⇒ Object
59 60 61 |
# File 'lib/bindata/alignment.rb', line 59 def read_and_return_value(io) super(BitAlignedIO.new(io)) end |