Use seek and pos on seekable streams
The number of bytes remaining in the input stream.
# File lib/bindata/io.rb, line 197 def num_bytes_remaining mark = raw_io.pos raw_io.seek(0, ::IO::SEEK_END) bytes_remaining = raw_io.pos - mark raw_io.seek(mark, ::IO::SEEK_SET) bytes_remaining end
Returns the current offset of the io stream. Offset will be rounded up when reading bitfields.
# File lib/bindata/io.rb, line 192 def offset raw_io.pos - @initial_pos end
[Validate]
Generated with the Darkfish Rdoc Generator 2.