public class ReadableSizedSelectionChannel extends ReadableBufferedChannel
Constructor and Description |
---|
ReadableSizedSelectionChannel(CompletionListener completionListener,
Buffer buffer,
ReadableSelectionChannel source,
long availableSize,
WakeupListener wakeupListener)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected long |
getAvailableSize()
Returns the remaining size that should be read from the source channel.
|
int |
onDrain(Buffer buffer,
int maxDrained,
Object... args)
Drains the byte buffer.
|
protected void |
setAvailableSize(long availableSize)
Sets the remaining size that should be read from the source channel.
|
couldDrain, couldFill, isEndReached, onFill, onMessageCompleted, read, setEndReached
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 ReadableSizedSelectionChannel(CompletionListener completionListener, Buffer buffer, ReadableSelectionChannel source, long availableSize, WakeupListener wakeupListener)
completionListener
- The listener to callback upon reading completion.buffer
- The source byte buffer, typically remaining from previous read
processing.source
- The source channel.availableSize
- The total available size that can be read from the source
channel.wakeupListener
- The wakeup listener that will be notified.protected long getAvailableSize()
public int onDrain(Buffer buffer, int maxDrained, Object... args) throws IOException
ReadableBufferedChannel
onDrain
in interface BufferProcessor
onDrain
in class ReadableBufferedChannel
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
protected void setAvailableSize(long availableSize) throws IOException
availableSize
- The remaining size that should be read from the source
channel.IOException
Copyright © 2005–2016. All rights reserved.