public class BoundedInputStream
extends java.io.FilterInputStream
| Constructor and Description |
|---|
BoundedInputStream(java.io.InputStream inputStream,
int bound)
Creates a new instance of the BoundedInputStream class.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
int |
read() |
int |
read(byte[] buffer,
int offset,
int length) |
long |
skip(long count) |
BoundedInputStream |
subStream(int bound)
Creates a new BoundedInputStream wrapping the same InputStream as this one, starting at the current position, with
the given bound.
|
public BoundedInputStream(java.io.InputStream inputStream,
int bound)
inputStream - The InputStream to wrap.bound - The maximum number of bytes that can be read with this instance.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic long skip(long count)
throws java.io.IOException
skip in class java.io.FilterInputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class java.io.FilterInputStreamjava.io.IOExceptionpublic BoundedInputStream subStream(int bound)
bound - The bound of the sub-stream.