class BitGirder::Io::BinaryIo

Attributes

conv[R]
pos[R]

pos returns the zero-indexed position of the next byte that would be read, in the case of a reader, or the number of bytes that have been written in the case of a writer. This value is only valid as long as no exceptions have been encountered in any of the read|write methods and all access to the underlying io object has been through this instance the read* methods

Private Class Methods

new_be( opts ) click to toggle source
# File lib/bitgirder/io.rb, line 770
def self.new_be( opts )
    self.new_with_order( ORDER_BIG_ENDIAN, opts )
end
new_le( opts ) click to toggle source
# File lib/bitgirder/io.rb, line 766
def self.new_le( opts )
    self.new_with_order( ORDER_LITTLE_ENDIAN, opts )
end
new_with_order( ord, opts ) click to toggle source
# File lib/bitgirder/io.rb, line 762
def self.new_with_order( ord, opts )
    self.new( { :order => ord }.merge( opts ) )
end

Public Instance Methods

close() click to toggle source
# File lib/bitgirder/io.rb, line 750
def close
    @io.close if @io.respond_to?( :close )
end

Private Instance Methods

impl_initialize() click to toggle source
Calls superclass method
# File lib/bitgirder/io.rb, line 755
def impl_initialize

    super
    @conv = BinaryConverter.new( :order => @order )
    @pos = 0
end