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
#clear, #clear?, #eql?, #hash, #initialize, #method_missing, #respond_to?, #value, #value=
Methods inherited from Base
#==, #assign, #clear, #clear?, #debug_name, #debug_name_of, #eval_parameter, #get_parameter, #has_parameter?, #initialize, #inspect, #num_bytes, #offset, #offset_of, #pretty_print, read, #read, register, register_class, register_self, register_subclasses, #rel_offset, #snapshot, #to_binary_s, #to_s, #write
Methods included from AcceptedParametersMixin
Constructor Details
This class inherits a constructor from BinData::BasePrimitive
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BinData::BasePrimitive