BufferedByteChannel, BufferedReadableByteChannel, java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.Channel, java.nio.channels.ReadableByteChannelpublic class InputStreamWrapperChannel extends BufferedByteChannelBase implements BufferedReadableByteChannel
bb, buffer, REUSABLE_BUFF_SIZE_MAX, REUSABLE_BUFF_SIZE_MIN| Constructor | Description |
|---|---|
InputStreamWrapperChannel(int buffSize) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
static BufferedReadableByteChannel |
getThreadLocalInstance(java.io.InputStream in,
long remainingSize) |
Wraps the given input stream into the special stateless and reusable (thread local) byte
channel
|
int |
read(java.nio.ByteBuffer dst) |
bufferbuffer, isOpenpublic final int read(java.nio.ByteBuffer dst)
throws java.io.IOException
read in interface java.nio.channels.ReadableByteChanneljava.io.IOExceptionpublic static BufferedReadableByteChannel getThreadLocalInstance(java.io.InputStream in, long remainingSize) throws java.lang.IllegalStateException
in - the input stream to wrapremainingSize - the estimated size of the data to be read from the given inputjava.lang.IllegalStateException - if negative remaining size is specifiedpublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.nio.channels.Channelclose in interface java.io.Closeablejava.io.IOException