public class ChannelBufferInput extends java.lang.Object implements MessageBufferInput
MessageBufferInput adapter for ReadableByteChannel| Constructor and Description |
|---|
ChannelBufferInput(java.nio.channels.ReadableByteChannel channel) |
ChannelBufferInput(java.nio.channels.ReadableByteChannel channel,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the input.
|
MessageBuffer |
next()
Returns a next buffer to read.
|
java.nio.channels.ReadableByteChannel |
reset(java.nio.channels.ReadableByteChannel channel)
Reset channel.
|
public ChannelBufferInput(java.nio.channels.ReadableByteChannel channel)
public ChannelBufferInput(java.nio.channels.ReadableByteChannel channel,
int bufferSize)
public java.nio.channels.ReadableByteChannel reset(java.nio.channels.ReadableByteChannel channel)
throws java.io.IOException
channel - new channeljava.io.IOExceptionpublic MessageBuffer next() throws java.io.IOException
MessageBufferInputThis method should return a MessageBuffer instance that has data filled in. When this method is called twice, the previously returned buffer is no longer used. Thus implementation of this method can safely discard it. This is useful when it uses a memory pool.
next in interface MessageBufferInputjava.io.IOException - when IO error occurred when reading the datapublic void close()
throws java.io.IOException
MessageBufferInput
When this method is called, the buffer previously returned from MessageBufferInput.next() method is no longer used.
Thus implementation of this method can safely discard it.
If the input is already closed then invoking this method has no effect.
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface MessageBufferInputjava.io.IOException - when IO error occurred when closing the data source