org.archive.io
Class SeekReader

java.lang.Object
  extended by java.io.Reader
      extended by org.archive.io.SeekReader
All Implemented Interfaces:
it.unimi.dsi.fastutil.io.RepositionableStream, java.io.Closeable, java.lang.Readable
Direct Known Subclasses:
PieceReader

public abstract class SeekReader
extends java.io.Reader
implements it.unimi.dsi.fastutil.io.RepositionableStream

Base class for repositionable readers.

Author:
pjack

Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
SeekReader()
           
 
Method Summary
 void mark(int limit)
          Marks the current position of the stream.
 boolean markSupported()
          Returns true, since SeekInputStreams support mark/reset by default.
 void reset()
          Resets this stream to its marked position.
 
Methods inherited from class java.io.Reader
close, read, read, read, read, ready, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.io.RepositionableStream
position, position
 

Constructor Detail

SeekReader

public SeekReader()
Method Detail

mark

public void mark(int limit)
Marks the current position of the stream. The limit parameter is ignored; the mark will remain valid until reset is called or the stream is closed.

Overrides:
mark in class java.io.Reader
Parameters:
limit - ignored

reset

public void reset()
           throws java.io.IOException
Resets this stream to its marked position.

Overrides:
reset in class java.io.Reader
Throws:
java.io.IOException - if there is no mark, or if an IO error occurs

markSupported

public boolean markSupported()
Returns true, since SeekInputStreams support mark/reset by default.

Overrides:
markSupported in class java.io.Reader
Returns:
true


Copyright © 2003-2011 Internet Archive. All Rights Reserved.