Module: BinData::IO::Read::UnSeekableStream

Defined in:
lib/bindata/io.rb

Overview

Manually keep track of offset for unseekable streams.

Instance Method Summary collapse

Instance Method Details

#num_bytes_remainingObject

The number of bytes remaining in the input stream.

Raises:

  • (IOError)


235
236
237
# File 'lib/bindata/io.rb', line 235

def num_bytes_remaining
  raise IOError, "stream is unseekable"
end

#offsetObject

Returns the current offset of the io stream. The exact value of the offset when reading bitfields is not defined.



230
231
232
# File 'lib/bindata/io.rb', line 230

def offset
  @read_count ||= 0
end