Class ReadableChunkedChannel
- 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.ReadableChunkedChannel
-
- 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 ReadableChunkedChannel extends ReadableBufferedChannel
Deprecated.Will be removed to favor lower-level network extensions allowing more control at the Restlet API level.Readable byte channel capable of decoding chunked entities.
-
-
Field Summary
Fields Modifier and Type Field Description private ChunkStatechunkStateDeprecated.The chunk state.private java.lang.StringBuilderlineBuilderDeprecated.The line builder to parse chunk size or trailer.private BufferStatelineBuilderStateDeprecated.The line builder state.private intremainingChunkSizeDeprecated.The remaining chunk size that should be read from the source channel.
-
Constructor Summary
Constructors Constructor Description ReadableChunkedChannel(CompletionListener completionListener, Buffer buffer, ReadableSelectionChannel source, WakeupListener wakeupListener)Deprecated.Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidclearLineBuilder()Deprecated.Clears the line builder and adjust its state.protected ChunkStategetChunkState()Deprecated.Returns the chunk state.protected java.lang.StringBuildergetLineBuilder()Deprecated.Returns the line builder to parse chunk size or trailer.protected BufferStategetLineBuilderState()Deprecated.Returns the line builder state.protected intgetRemainingChunkSize()Deprecated.Returns the remaining chunk size that should be read from the source channel.intonDrain(Buffer buffer, int maxDrained, java.lang.Object... args)Deprecated.Drains the byte buffer.protected voidsetChunkState(ChunkState chunkState)Deprecated.Sets the chunk state.protected voidsetLineBuilderState(BufferState lineBuilderState)Deprecated.Sets the line builder state.protected voidsetRemainingChunkSize(int remainingChunkSize)Deprecated.Sets the remaining chunk 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
-
-
-
-
Field Detail
-
chunkState
private volatile ChunkState chunkState
Deprecated.The chunk state.
-
lineBuilder
private final java.lang.StringBuilder lineBuilder
Deprecated.The line builder to parse chunk size or trailer.
-
lineBuilderState
private volatile BufferState lineBuilderState
Deprecated.The line builder state.
-
remainingChunkSize
private volatile int remainingChunkSize
Deprecated.The remaining chunk size that should be read from the source channel.
-
-
Constructor Detail
-
ReadableChunkedChannel
public ReadableChunkedChannel(CompletionListener completionListener, Buffer buffer, ReadableSelectionChannel source, 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.wakeupListener- The wakeup listener that will be notified.
-
-
Method Detail
-
clearLineBuilder
protected void clearLineBuilder()
Deprecated.Clears the line builder and adjust its state.
-
getChunkState
protected ChunkState getChunkState()
Deprecated.Returns the chunk state.- Returns:
- The chunk state.
-
getLineBuilder
protected java.lang.StringBuilder getLineBuilder()
Deprecated.Returns the line builder to parse chunk size or trailer.- Returns:
- The line builder to parse chunk size or trailer.
-
getLineBuilderState
protected BufferState getLineBuilderState()
Deprecated.Returns the line builder state.- Returns:
- The line builder state.
-
getRemainingChunkSize
protected int getRemainingChunkSize()
Deprecated.Returns the remaining chunk size that should be read from the source channel.- Returns:
- The remaining chunk 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.Drains 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 "functional" bytes drained.
- Throws:
java.io.IOException
-
setChunkState
protected void setChunkState(ChunkState chunkState)
Deprecated.Sets the chunk state.- Parameters:
chunkState- The chunk state.
-
setLineBuilderState
protected void setLineBuilderState(BufferState lineBuilderState)
Deprecated.Sets the line builder state.- Parameters:
lineBuilderState- The line builder state.
-
setRemainingChunkSize
protected void setRemainingChunkSize(int remainingChunkSize)
Deprecated.Sets the remaining chunk size that should be read from the source channel.- Parameters:
remainingChunkSize- The remaining chunk size that should be read from the source channel.
-
-