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, read
public LookaheadInputStream(InputStream in)
public int peek() throws IOException
IOException
public int read() throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class FilterInputStream
IOException
public long skip(long n) throws IOException
skip
in class FilterInputStream
IOException
public int available() throws IOException
available
in class FilterInputStream
IOException
public void mark(int readlimit)
mark
in class FilterInputStream
public void reset() throws IOException
reset
in class FilterInputStream
IOException
Copyright © 2023. All rights reserved.