Class: BinData::Skip::SkipUntilValidPlugin::ReadaheadIO

Inherits:
IO::Transform
  • Object
show all
Defined in:
lib/bindata/skip.rb

Instance Method Summary collapse

Methods inherited from IO::Transform

#after_read_transform, #after_write_transform, #initialize, #num_bytes_remaining, #offset, #prepend_to_chain, #read, #seek_abs, #seekable?, #skip, transform_changes_stream_length!, #write

Constructor Details

This class inherits a constructor from BinData::IO::Transform

Instance Method Details

#before_transformObject



194
195
196
197
198
199
200
# File 'lib/bindata/skip.rb', line 194

def before_transform
  if !seekable?
    raise IOError, "readahead is not supported on unseekable streams"
  end

  @mark = offset
end

#rollbackObject



202
203
204
# File 'lib/bindata/skip.rb', line 202

def rollback
  seek_abs(@mark)
end