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)


232
233
234
# File 'lib/bindata/io.rb', line 232

def num_bytes_remaining
  raise IOError, "stream is unseekable"
end

#offsetObject

Returns the current offset of the io stream. Offset will be rounded up when reading bitfields.



227
228
229
# File 'lib/bindata/io.rb', line 227

def offset
  @read_count ||= 0
end