reset
Repositions this stream to the position at the time the mark method was last called on this input stream.
The general contract of reset is:
If the method
markSupportedreturnstrue, then:If the method
markhas not been called since the stream was created, or the number of bytes read from the stream sincemarkwas last called is larger than the argument tomarkat that last call, then anIOExceptionmight be thrown.If such an
IOExceptionis not thrown, then the stream is reset to a state such that all the bytes read since the most recent call tomark(or since the start of the file, ifmarkhas not been called) will be resupplied to subsequent callers of thereadmethod, followed by any bytes that otherwise would have been the next input data as of the time of the call toreset.If the method
markSupportedreturnsfalse, then:The call to
resetmay throw anIOException.If an
IOExceptionis not thrown, then the stream is reset to a fixed state that depends on the particular type of the input stream and how it was created. The bytes that will be supplied to subsequent callers of thereadmethod depend on the particular type of the input stream.
See also
Throws
if this stream has not been marked or if the mark has been invalidated.