InputStream.reset

Repositions this stream to the position at the time the <code>mark</code> method was last called on this input stream.

<p> The general contract of <code>reset</code> is:

<ul> <li> If the method <code>markSupported</code> returns <code>true</code>, then:

<ul><li> If the method <code>mark</code> has not been called since the stream was created, or the number of bytes read from the stream since <code>mark</code> was last called is larger than the argument to <code>mark</code> at that last call, then an <code>IOException</code> might be thrown.

<li> If such an <code>IOException</code> is not thrown, then the stream is reset to a state such that all the bytes read since the most recent call to <code>mark</code> (or since the start of the file, if <code>mark</code> has not been called) will be resupplied to subsequent callers of the <code>read</code> method, followed by any bytes that otherwise would have been the next input data as of the time of the call to <code>reset</code>. </ul>

<li> If the method <code>markSupported</code> returns <code>false</code>, then:

<ul><li> The call to <code>reset</code> may throw an <code>IOException</code>.

<li> If an <code>IOException</code> is 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 the <code>read</code> method depend on the particular type of the input stream. </ul></ul>

<p>The method <code>reset</code> for class <code>InputStream</code> does nothing except throw an <code>IOException</code>.

@exception IOException if this stream has not been marked or if the mark has been invalidated. @see java.io.InputStream#mark(int) @see java.io.IOException

class InputStream
void
reset
()

Meta