Class: BinData::ResumeByteAlignment
- Inherits:
-
Base
- Object
- Base
- BinData::ResumeByteAlignment
show all
- Defined in:
- lib/bindata/alignment.rb
Overview
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")
Instance Attribute Summary
Attributes inherited from Base
#parent
Instance Method Summary
collapse
Methods inherited from Base
#==, #=~, #abs_offset, arg_processor, auto_call_delayed_io, bindata_name, #clear, #debug_name, #eval_parameter, #get_parameter, #has_parameter?, #initialize_instance, #initialize_with_warning, #inspect, #lazy_evaluator, #new, #num_bytes, #pretty_print, #read, read, register_subclasses, #rel_offset, #safe_respond_to?, #to_binary_s, #to_hex, #to_s, unregister_self, #write
#accepted_parameters, #default_parameters, #mandatory_parameters, #mutually_exclusive_parameters, #optional_parameters
included, #initialize_shared_instance
included, #initialize_shared_instance
Methods included from Framework
#bit_aligned?, #debug_name_of, #offset_of
Instance Method Details
#assign(val) ⇒ Object
17
|
# File 'lib/bindata/alignment.rb', line 17
def assign(val); end
|
#clear? ⇒ Boolean
16
|
# File 'lib/bindata/alignment.rb', line 16
def clear?; true; end
|
#do_num_bytes ⇒ Object
19
|
# File 'lib/bindata/alignment.rb', line 19
def do_num_bytes; 0; end
|
#do_read(io) ⇒ Object
21
22
23
|
# File 'lib/bindata/alignment.rb', line 21
def do_read(io)
io.reset_read_bits
end
|
#do_write(io) ⇒ Object
25
26
27
|
# File 'lib/bindata/alignment.rb', line 25
def do_write(io)
io.flushbits
end
|
#snapshot ⇒ Object
18
|
# File 'lib/bindata/alignment.rb', line 18
def snapshot; nil; end
|