public class LookaheadInputStream extends FilterInputStream
InputStream that allows peek()ing one byte ahead in the stream. This is useful for
detecting the end of a stream without actually consuming any data in the process (e.g. so the stream can be passed to
another library that doesn't handle end-of-stream as the first byte well).in| Constructor and Description |
|---|
LookaheadInputStream(InputStream in) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
mark(int readlimit) |
int |
peek() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
close, markSupported, readpublic LookaheadInputStream(InputStream in)
public int peek()
throws IOException
IOExceptionpublic int read()
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class FilterInputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class FilterInputStreamIOExceptionpublic int available()
throws IOException
available in class FilterInputStreamIOExceptionpublic void mark(int readlimit)
mark in class FilterInputStreampublic void reset()
throws IOException
reset in class FilterInputStreamIOExceptionCopyright © 2022. All rights reserved.