class BinData::ResumeByteAlignment
Resets the stream alignment to the next byte. This is only useful when using bit-based primitives.
class MyRec < BinData::Record bit4 :a resume_byte_alignment bit4 :b end MyRec.read("\x12\x34") #=> {"a" => 1, "b" => 3}
Public Instance Methods
assign(val)
click to toggle source
# File lib/bindata/alignment.rb, line 17 def assign(val); end
clear?()
click to toggle source
# File lib/bindata/alignment.rb, line 16 def clear?; true; end
do_num_bytes()
click to toggle source
# File lib/bindata/alignment.rb, line 19 def do_num_bytes; 0; end
do_read(io)
click to toggle source
# File lib/bindata/alignment.rb, line 21 def do_read(io) io.reset_read_bits end
do_write(io)
click to toggle source
# File lib/bindata/alignment.rb, line 25 def do_write(io) io.flushbits end
snapshot()
click to toggle source
# File lib/bindata/alignment.rb, line 18 def snapshot; nil; end