Method: Down::ChunkedIO#rewind

Defined in:
lib/down/chunked_io.rb

#rewindObject

Implements IO#rewind semantics. Rewinds the Down::ChunkedIO by rewinding the cache and setting the position to the beginning of the file. Raises IOError if closed or not rewindable.



212
213
214
215
216
217
218
# File 'lib/down/chunked_io.rb', line 212

def rewind
  fail IOError, "closed stream" if closed?
  fail IOError, "this Down::ChunkedIO is not rewindable" if cache.nil?

  cache.rewind
  @position = 0
end