|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.restlet.engine.io.WrapperChannel<T>
org.restlet.engine.io.WrapperSelectionChannel<T>
org.restlet.engine.io.BufferedSelectionChannel<T>
public abstract class BufferedSelectionChannel<T extends SelectionChannel>
Byte channel wrapping a byte buffer.
| Constructor Summary | |
|---|---|
BufferedSelectionChannel(Buffer buffer,
T source,
WakeupListener wakeupListener)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
canLoop(Buffer buffer,
Object... args)
Indicates if the processing loop can continue. |
void |
close()
Delegates to the wrapped channel. |
Buffer |
getBuffer()
Returns the source buffer. |
void |
onFillEof()
Called back when a fill operation returns with an EOF status. |
void |
postProcess(int drained)
Does nothing by default. |
int |
preProcess(int maxDrained,
Object... args)
Does nothing by default. |
| Methods inherited from class org.restlet.engine.io.WrapperSelectionChannel |
|---|
getRegistration, isBlocking, setRegistration, toString |
| Methods inherited from class org.restlet.engine.io.WrapperChannel |
|---|
getWrappedChannel, isOpen |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.restlet.engine.io.BufferProcessor |
|---|
couldFill, onDrain, onFill |
| Methods inherited from interface java.nio.channels.Channel |
|---|
isOpen |
| Constructor Detail |
|---|
public BufferedSelectionChannel(Buffer buffer,
T source,
WakeupListener wakeupListener)
buffer - The source byte buffer, typically remaining from previous read
processing.source - The source channel.wakeupListener - The wakeup listener that will be notified.| Method Detail |
|---|
public boolean canLoop(Buffer buffer,
Object... args)
canLoop in interface BufferProcessorbuffer - The IO buffer to drain.args - The optional arguments to pass back to the callbacks.
public void close()
throws IOException
WrapperChannel
close in interface Closeableclose in interface Channelclose in class WrapperChannel<T extends SelectionChannel>IOExceptionpublic Buffer getBuffer()
public void onFillEof()
onFillEof in interface BufferProcessor
public void postProcess(int drained)
throws IOException
postProcess in interface BufferProcessordrained - The number of bytes drained or -1 if the filling source has
ended.
IOException
public int preProcess(int maxDrained,
Object... args)
throws IOException
preProcess in interface BufferProcessormaxDrained - The maximum number of bytes drained by this call or 0 for
unlimited length.args - The optional arguments to pass back to the callbacks.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||