Class: BinData::Skip
- Inherits:
-
BasePrimitive
- Object
- Base
- BasePrimitive
- BinData::Skip
- Defined in:
- lib/bindata/skip.rb
Overview
Skip will skip over bytes from the input stream. If the stream is not seekable, then the bytes are consumed and discarded.
When writing, skip will write :length
number of zero bytes.
require 'bindata'
class A < BinData::Record
skip :length => 5
string :a, :read_length => 5
end
obj = A.read("abcdefghij")
obj.a #=> "fghij"
Parameters
Skip objects accept all the params that BinData::BasePrimitive does, as well as the following:
:length
-
The number of bytes to skip.
Instance Attribute Summary
Attributes inherited from Base
Method Summary
Methods inherited from BasePrimitive
#<=>, #assign, bit_aligned, #clear, #clear?, #do_num_bytes, #do_read, #do_read_with_check_value, #do_write, #eql?, #hash, #initialize_instance, #initialize_shared_instance, #method_missing, #respond_to?, #snapshot, turn_off_tracing, turn_on_tracing, #value
Methods inherited from Base
#==, #=~, arg_extractor, #assign, bindata_name, #clear, #clear?, #debug_name, #debug_name_of, #eval_parameter, #get_parameter, #has_parameter?, #initialize_instance, #initialize_with_warning, #inspect, #lazy_evaluator, #new, #num_bytes, #offset, #offset_of, #pretty_print, #read, read, register_subclasses, #rel_offset, #safe_respond_to?, #snapshot, #to_binary_s, #to_s, unregister_self, #write
Methods included from CheckOrAdjustOffsetMixin
#do_read_with_adjust_offset, #do_read_with_check_offset, included
Methods included from AcceptedParametersMixin
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BinData::BasePrimitive