< prev index next >

src/java.base/share/classes/java/io/FilterInputStream.java

Print this page

187     }
188 
189     /**
190      * Marks the current position in this input stream. A subsequent
191      * call to the {@code reset} method repositions this stream at
192      * the last marked position so that subsequent reads re-read the same bytes.
193      * <p>
194      * The {@code readlimit} argument tells this input stream to
195      * allow that many bytes to be read before the mark position gets
196      * invalidated.
197      *
198      * @implSpec
199      * This method simply performs {@code in.mark(readlimit)}.
200      *
201      * @param   readlimit   the maximum limit of bytes that can be read before
202      *                      the mark position becomes invalid.
203      * @see     java.io.FilterInputStream#in
204      * @see     java.io.FilterInputStream#reset()
205      */
206     @Override
207     public synchronized void mark(int readlimit) {
208         in.mark(readlimit);
209     }
210 
211     /**
212      * Repositions this stream to the position at the time the
213      * {@code mark} method was last called on this input stream.
214      * <p>
215      * Stream marks are intended to be used in
216      * situations where you need to read ahead a little to see what's in
217      * the stream. Often this is most easily done by invoking some
218      * general parser. If the stream is of the type handled by the
219      * parse, it just chugs along happily. If the stream is not of
220      * that type, the parser should toss an exception when it fails.
221      * If this happens within readlimit bytes, it allows the outer
222      * code to reset the stream and try another parser.
223      *
224      * @implSpec
225      * This method simply performs {@code in.reset()}.
226      *
227      * @throws     IOException  if the stream has not been marked or if the
228      *               mark has been invalidated.
229      * @see        java.io.FilterInputStream#in
230      * @see        java.io.FilterInputStream#mark(int)
231      */
232     @Override
233     public synchronized void reset() throws IOException {
234         in.reset();
235     }
236 
237     /**
238      * Tests if this input stream supports the {@code mark}
239      * and {@code reset} methods.
240      *
241      * @implSpec
242      * This method simply performs {@code in.markSupported()}.
243      *
244      * @return  {@code true} if this stream type supports the
245      *          {@code mark} and {@code reset} method;
246      *          {@code false} otherwise.
247      * @see     java.io.FilterInputStream#in
248      * @see     java.io.InputStream#mark(int)
249      * @see     java.io.InputStream#reset()
250      */
251     @Override
252     public boolean markSupported() {
253         return in.markSupported();

187     }
188 
189     /**
190      * Marks the current position in this input stream. A subsequent
191      * call to the {@code reset} method repositions this stream at
192      * the last marked position so that subsequent reads re-read the same bytes.
193      * <p>
194      * The {@code readlimit} argument tells this input stream to
195      * allow that many bytes to be read before the mark position gets
196      * invalidated.
197      *
198      * @implSpec
199      * This method simply performs {@code in.mark(readlimit)}.
200      *
201      * @param   readlimit   the maximum limit of bytes that can be read before
202      *                      the mark position becomes invalid.
203      * @see     java.io.FilterInputStream#in
204      * @see     java.io.FilterInputStream#reset()
205      */
206     @Override
207     public void mark(int readlimit) {
208         in.mark(readlimit);
209     }
210 
211     /**
212      * Repositions this stream to the position at the time the
213      * {@code mark} method was last called on this input stream.
214      * <p>
215      * Stream marks are intended to be used in
216      * situations where you need to read ahead a little to see what's in
217      * the stream. Often this is most easily done by invoking some
218      * general parser. If the stream is of the type handled by the
219      * parse, it just chugs along happily. If the stream is not of
220      * that type, the parser should toss an exception when it fails.
221      * If this happens within readlimit bytes, it allows the outer
222      * code to reset the stream and try another parser.
223      *
224      * @implSpec
225      * This method simply performs {@code in.reset()}.
226      *
227      * @throws     IOException  if the stream has not been marked or if the
228      *               mark has been invalidated.
229      * @see        java.io.FilterInputStream#in
230      * @see        java.io.FilterInputStream#mark(int)
231      */
232     @Override
233     public void reset() throws IOException {
234         in.reset();
235     }
236 
237     /**
238      * Tests if this input stream supports the {@code mark}
239      * and {@code reset} methods.
240      *
241      * @implSpec
242      * This method simply performs {@code in.markSupported()}.
243      *
244      * @return  {@code true} if this stream type supports the
245      *          {@code mark} and {@code reset} method;
246      *          {@code false} otherwise.
247      * @see     java.io.FilterInputStream#in
248      * @see     java.io.InputStream#mark(int)
249      * @see     java.io.InputStream#reset()
250      */
251     @Override
252     public boolean markSupported() {
253         return in.markSupported();
< prev index next >