Class ReadableSizedSelectionChannel
- 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<ReadableSelectionChannel>
-
- org.restlet.ext.nio.internal.channel.ReadableBufferedChannel
-
- org.restlet.ext.nio.internal.channel.ReadableSizedSelectionChannel
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel,java.nio.channels.ReadableByteChannel,BlockableChannel,ReadableSelectionChannel,SelectionChannel,BufferProcessor,CompletionListener
@Deprecated public class ReadableSizedSelectionChannel extends ReadableBufferedChannel
Deprecated.Will be removed to favor lower-level network extensions allowing more control at the Restlet API level.Readable byte channel enforcing a maximum size and wrapping a selectable channel.
-
-
Field Summary
Fields Modifier and Type Field Description private longavailableSizeDeprecated.The remaining size that should be read from the source channel.
-
Constructor Summary
Constructors Constructor Description ReadableSizedSelectionChannel(CompletionListener completionListener, Buffer buffer, ReadableSelectionChannel source, long availableSize, WakeupListener wakeupListener)Deprecated.Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected longgetAvailableSize()Deprecated.Returns the remaining size that should be read from the source channel.intonDrain(Buffer buffer, int maxDrained, java.lang.Object... args)Deprecated.Drains the byte buffer.protected voidsetAvailableSize(long availableSize)Deprecated.Sets the remaining size that should be read from the source channel.-
Methods inherited from class org.restlet.ext.nio.internal.channel.ReadableBufferedChannel
couldDrain, couldFill, isEndReached, onFill, onMessageCompleted, read, setEndReached
-
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
-
ReadableSizedSelectionChannel
public ReadableSizedSelectionChannel(CompletionListener completionListener, Buffer buffer, ReadableSelectionChannel source, long availableSize, WakeupListener wakeupListener)
Deprecated.Constructor.- Parameters:
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.
-
-
Method Detail
-
getAvailableSize
protected long getAvailableSize()
Deprecated.Returns the remaining size that should be read from the source channel.- Returns:
- The remaining size that should be read from the source channel.
-
onDrain
public int onDrain(Buffer buffer, int maxDrained, java.lang.Object... args) throws java.io.IOException
Deprecated.Description copied from class:ReadableBufferedChannelDrains the byte buffer.- Specified by:
onDrainin interfaceBufferProcessor- Overrides:
onDrainin classReadableBufferedChannel- 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
-
setAvailableSize
protected void setAvailableSize(long availableSize) throws java.io.IOExceptionDeprecated.Sets the remaining size that should be read from the source channel.- Parameters:
availableSize- The remaining size that should be read from the source channel.- Throws:
java.io.IOException
-
-