/** * Resets this stream to the last marked location. * * @throws IOException if this stream is closed, no mark has been put or the mark is no longer * valid because more than {@code readlimit} bytes have been read since * setting the mark. * @see #mark(int) */ @Override public synchronized void reset() throws IOException { if (buf == null) { throw new IOException("Stream is closed"); } if (-1 == markpos) { throw new InvalidMarkException("Mark has been invalidated, pos: " + pos + " markLimit: " + marklimit); } pos = markpos; }
/** * Resets this stream to the last marked location. * * @throws IOException if this stream is closed, no mark has been put or the mark is no longer * valid because more than {@code readlimit} bytes have been read since * setting the mark. * @see #mark(int) */ @Override public synchronized void reset() throws IOException { if (buf == null) { throw new IOException("Stream is closed"); } if (-1 == markpos) { throw new InvalidMarkException("Mark has been invalidated, pos: " + pos + " markLimit: " + marklimit); } pos = markpos; }
/** * Resets this stream to the last marked location. * * @throws IOException * if this stream is closed, no mark has been set or the mark is * no longer valid because more than {@code readlimit} bytes * have been read since setting the mark. * @see #mark(int) */ @Override public synchronized void reset() throws IOException { if (buf == null) { throw new IOException("Stream is closed"); } if (-1 == markpos) { throw new InvalidMarkException("Mark has been invalidated"); } pos = markpos; }