public class WritableChannelWrapper extends ChannelWrapper implements WritableByteChannel
ChannelWrapper.Consumer<T>, ChannelWrapper.Key<T>| Modifier and Type | Field and Description |
|---|---|
protected WritableByteChannel |
channel |
consumers| Constructor and Description |
|---|
WritableChannelWrapper(WritableByteChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying channel and completes
any outstanding operations in the consumers.
|
boolean |
isOpen()
Flag indicating whether the underlying channel
is open.
|
int |
write(ByteBuffer buffer)
Writes data to the wrapped channel, while passing an
exact copy to the registered consumers.
|
protected WritableByteChannel channel
public WritableChannelWrapper(WritableByteChannel channel)
public int write(ByteBuffer buffer) throws IOException
write in interface WritableByteChannelbuffer - the buffer to write to the wrapped channelIOException - if an IO error occurspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface Channelclose in class ChannelWrapperIOException - if an IO error occursCopyright © 2015. All Rights Reserved.