Module: BinData::IO::Read::UnSeekableStream
- Defined in:
- lib/bindata/io.rb
Overview
Manually keep track of offset for unseekable streams.
Instance Method Summary collapse
-
#num_bytes_remaining ⇒ Object
The number of bytes remaining in the input stream.
-
#offset ⇒ Object
Returns the current offset of the io stream.
Instance Method Details
#num_bytes_remaining ⇒ Object
The number of bytes remaining in the input stream.
232 233 234 |
# File 'lib/bindata/io.rb', line 232 def num_bytes_remaining raise IOError, "stream is unseekable" end |
#offset ⇒ Object
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 |