BufferedInputStream.reset

BufferedInputStream.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.

If the stream has not been marked, or if the mark has been invalidated, an IOException is thrown. 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 parser, it just chugs along happily. If the stream is not of that type, the parser should toss an exception when it fails. If an exception gets tossed within readlimit bytes, the parser will allow the outer code to reset the stream and to try another parser.

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