FilterInputStream.reset

FilterInputStream.reset

Class Overview | Class Members | This Package | All Packages

Syntax
public synchronized void reset() throws IOException
Description
Repositions this stream to the position at the time the mark method was last called on this input stream.

The reset method of FilterInputStream calls the reset method of its underlying input stream.

Stream marks are intended to be used in situations where you need to read ahead a little to see what's in the stream. Often this is most easily done by invoking some general parser. If the stream is of the type handled by the parse, it just chugs along happily. If the stream is not of that type, the parser should toss an exception when it fails. If this happens within readlimit bytes, it allows the outer code to reset the stream and try another parser.

Exceptions
IOException if the stream has not been marked or if the mark has been invalidated.
Overrides
reset in class InputStream
See Also
in, mark