Class WritableBufferedChannel
- java.lang.Object
-
- org.restlet.ext.nio.internal.channel.WrapperChannel<T>
-
- org.restlet.ext.nio.internal.channel.WrapperSelectionChannel<T>
-
- org.restlet.ext.nio.internal.channel.BufferedSelectionChannel<WritableSelectionChannel>
-
- org.restlet.ext.nio.internal.channel.WritableBufferedChannel
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel,java.nio.channels.WritableByteChannel,BlockableChannel,SelectionChannel,BufferProcessor,WritableSelectionChannel
- Direct Known Subclasses:
WritableSslChannel
@Deprecated public class WritableBufferedChannel extends BufferedSelectionChannel<WritableSelectionChannel> implements WritableSelectionChannel
Deprecated.Will be removed to favor lower-level network extensions allowing more control at the Restlet API level.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
Constructors Constructor Description WritableBufferedChannel(Buffer buffer, WritableSelectionChannel target, WakeupListener wakeupListener)Deprecated.Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancouldDrain(Buffer buffer, java.lang.Object... args)Deprecated.Indicates if the buffer could be drained again.booleancouldFill(Buffer buffer, java.lang.Object... args)Deprecated.Indicates if the buffer could be filled again.intonDrain(Buffer buffer, int maxDrained, java.lang.Object... args)Deprecated.Drains the byte buffer.intonFill(Buffer buffer, java.lang.Object... args)Deprecated.Fills the byte buffer by writing the current message.intwrite(java.nio.ByteBuffer sourceBuffer)Deprecated.Reads some bytes and put them into the destination buffer.-
Methods inherited from class org.restlet.ext.nio.internal.channel.BufferedSelectionChannel
canLoop, close, getBuffer, onFillEof, postProcess, preProcess
-
Methods inherited from class org.restlet.ext.nio.internal.channel.WrapperSelectionChannel
getRegistration, isBlocking, setRegistration, toString
-
Methods inherited from class org.restlet.ext.nio.internal.channel.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.BlockableChannel
isBlocking
-
Methods inherited from interface org.restlet.engine.io.SelectionChannel
getRegistration
-
-
-
-
Constructor Detail
-
WritableBufferedChannel
public WritableBufferedChannel(Buffer buffer, WritableSelectionChannel target, WakeupListener wakeupListener)
Deprecated.Constructor.- Parameters:
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
-
couldDrain
public boolean couldDrain(Buffer buffer, java.lang.Object... args)
Deprecated.Indicates if the buffer could be drained again.- Parameters:
buffer- The IO buffer to drain.args- The optional arguments to pass back to the callbacks.- Returns:
- True if the buffer could be drained again.
-
couldFill
public boolean couldFill(Buffer buffer, java.lang.Object... args)
Deprecated.Indicates if the buffer could be filled again.- Specified by:
couldFillin interfaceBufferProcessor- Parameters:
buffer- The IO buffer to fill.args- The optional arguments to pass back to the callbacks.- Returns:
- True if the buffer could be filled again.
-
onDrain
public final int onDrain(Buffer buffer, int maxDrained, java.lang.Object... args) throws java.io.IOException
Deprecated.Drains the byte buffer.- Specified by:
onDrainin interfaceBufferProcessor- Parameters:
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.- Returns:
- The number of bytes drained.
- Throws:
java.io.IOException
-
onFill
public int onFill(Buffer buffer, java.lang.Object... args) throws java.io.IOException
Deprecated.Fills the byte buffer by writing the current message.- Specified by:
onFillin interfaceBufferProcessor- Parameters:
buffer- The IO buffer to drain.args- The optional arguments to pass back to the callbacks.- Returns:
- The number of bytes filled.
- Throws:
java.io.IOException
-
write
public int write(java.nio.ByteBuffer sourceBuffer) throws java.io.IOExceptionDeprecated.Reads some bytes and put them into the destination buffer. The bytes come from the underlying channel.- Specified by:
writein interfacejava.nio.channels.WritableByteChannel- Parameters:
sourceBuffer- The source buffer.- Returns:
- The number of bytes written, possibly 0.
- Throws:
java.io.IOException
-
-