public class WritableBufferedChannel extends BufferedSelectionChannel<WritableSelectionChannel> implements WritableSelectionChannel
Constructor and Description |
---|
WritableBufferedChannel(Buffer buffer,
WritableSelectionChannel target,
WakeupListener wakeupListener)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
couldDrain(Buffer buffer,
Object... args)
Indicates if the buffer could be drained again.
|
boolean |
couldFill(Buffer buffer,
Object... args)
Indicates if the buffer could be filled again.
|
int |
onDrain(Buffer buffer,
int maxDrained,
Object... args)
Drains the byte buffer.
|
int |
onFill(Buffer buffer,
Object... args)
Fills the byte buffer by writing the current message.
|
int |
write(ByteBuffer sourceBuffer)
Reads some bytes and put them into the destination buffer.
|
canLoop, close, getBuffer, onFillEof, postProcess, preProcess
getRegistration, isBlocking, setRegistration, toString
getWrappedChannel, isOpen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getRegistration
isBlocking
public WritableBufferedChannel(Buffer buffer, WritableSelectionChannel target, WakeupListener wakeupListener)
buffer
- The source byte buffer, typically remaining from previous read
processing.target
- The target channel.wakeupListener
- The wakeup listener that will be notified.public boolean couldDrain(Buffer buffer, Object... args)
buffer
- The IO buffer to drain.args
- The optional arguments to pass back to the callbacks.public boolean couldFill(Buffer buffer, Object... args)
couldFill
in interface BufferProcessor
buffer
- The IO buffer to fill.args
- The optional arguments to pass back to the callbacks.public final int onDrain(Buffer buffer, int maxDrained, Object... args) throws IOException
onDrain
in interface BufferProcessor
buffer
- The IO buffer to drain.maxDrained
- The maximum number of bytes drained by this call.args
- The optional arguments to pass back to the callbacks.IOException
public int onFill(Buffer buffer, Object... args) throws IOException
onFill
in interface BufferProcessor
buffer
- The IO buffer to drain.args
- The optional arguments to pass back to the callbacks.IOException
public int write(ByteBuffer sourceBuffer) throws IOException
write
in interface WritableByteChannel
sourceBuffer
- The source buffer.IOException
Copyright © 2005–2017. All rights reserved.