Closeable
, AutoCloseable
public final class ConstrainableInputStream extends BufferedInputStream
in
Modifier and Type | Method | 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, skip
read
readAllBytes, readNBytes, transferTo
public 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 BufferedInputStream
IOException
public ByteBuffer readToByteBuffer(int max) throws IOException
IOException
public void reset() throws IOException
reset
in class BufferedInputStream
IOException
public ConstrainableInputStream timeout(long startTimeNanos, long timeoutMillis)
Copyright © 2009–2018 Jonathan Hedley. All rights reserved.