|
||||||||||
| 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<WritableSelectionChannel>
org.restlet.engine.io.WritableBufferedChannel
public class WritableBufferedChannel
Writable byte channel based on a target socket channel. It is capable of first filling a buffer before draining it to the target channel.
| Constructor Summary | |
|---|---|
WritableBufferedChannel(Buffer buffer,
WritableSelectionChannel target,
WakeupListener wakeupListener)
Constructor. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class org.restlet.engine.io.BufferedSelectionChannel |
|---|
canLoop, close, getBuffer, onFillEof, postProcess, preProcess |
| 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.SelectionChannel |
|---|
getRegistration |
| Methods inherited from interface org.restlet.engine.io.BlockableChannel |
|---|
isBlocking |
| Methods inherited from interface java.nio.channels.Channel |
|---|
close, isOpen |
| Constructor Detail |
|---|
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.| Method Detail |
|---|
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 BufferProcessorbuffer - 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 BufferProcessorbuffer - 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 BufferProcessorbuffer - 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 WritableByteChannelsourceBuffer - The source buffer.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||