public final class ConstrainableInputStream
extends java.io.BufferedInputStream
Modifier and Type | Method and Description |
---|---|
int |
read(byte[] b,
int off,
int len) |
java.nio.ByteBuffer |
readToByteBuffer(int max)
Reads this inputstream to a ByteBuffer.
|
void |
reset() |
ConstrainableInputStream |
timeout(long startTimeNanos,
long timeoutMillis) |
static ConstrainableInputStream |
wrap(java.io.InputStream in,
int bufferSize,
int maxSize)
If this InputStream is not already a ConstrainableInputStream, let it be one.
|
public static ConstrainableInputStream wrap(java.io.InputStream in, int bufferSize, int maxSize)
in
- the input stream to (maybe) wrapbufferSize
- the buffer size to use when readingmaxSize
- the maximum size to allow to be read. 0 == infinite.public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.BufferedInputStream
java.io.IOException
public java.nio.ByteBuffer readToByteBuffer(int max) throws java.io.IOException
java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.BufferedInputStream
java.io.IOException
public ConstrainableInputStream timeout(long startTimeNanos, long timeoutMillis)