public final class ConstrainableInputStream extends BufferedInputStream
in| Modifier and Type | Method and Description |
|---|---|
int |
read(byte[] b,
int off,
int len) |
ByteBuffer |
readToByteBuffer(int max)
Reads this inputstream to a ByteBuffer.
|
void |
reset() |
ConstrainableInputStream |
timeout(long startTimeNanos,
long timeoutMillis) |
static ConstrainableInputStream |
wrap(InputStream in,
int bufferSize,
int maxSize)
If this InputStream is not already a ConstrainableInputStream, let it be one.
|
available, close, mark, markSupported, read, skipreadpublic static ConstrainableInputStream wrap(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 IOException
read in class BufferedInputStreamIOExceptionpublic ByteBuffer readToByteBuffer(int max) throws IOException
IOExceptionpublic void reset()
throws IOException
reset in class BufferedInputStreamIOExceptionpublic ConstrainableInputStream timeout(long startTimeNanos, long timeoutMillis)
Copyright © 2009–2025 Jonathan Hedley. All rights reserved.