public class ReadableChannelWrapper extends ChannelWrapper implements ReadableByteChannel
ChannelWrapper.Consumer<T>, ChannelWrapper.Key<T>| Modifier and Type | Field and Description |
|---|---|
protected ReadableByteChannel |
channel |
consumers| Constructor and Description |
|---|
ReadableChannelWrapper(ReadableByteChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the underlying read channel and complete any operations in the
consumer.
|
boolean |
isOpen()
Boolean flag indicating whether the channel is open or closed.
|
int |
read(ByteBuffer buffer)
Reads data from the channel and passes it to the consumer.
|
protected ReadableByteChannel channel
public ReadableChannelWrapper(ReadableByteChannel channel)
public int read(ByteBuffer buffer) throws IOException
read in interface ReadableByteChannelbuffer - the buffer to read intoIOException - if an IO error occurrspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface Channelclose in class ChannelWrapperIOException - if an IO error occurrsCopyright © 2021. All Rights Reserved.