| Modifier and Type | Field and Description |
|---|---|
| private final Attachable | |
| private final ByteBufferPool | |
| private final ByteBuffer | |
| private final ByteBuffer | |
| private int | |
| private static final int | |
| private static final int | |
| private final int | |
| private static final byte[] | CRLF
"\r\n" as bytes in US ASCII encoding. |
| private static final byte[] | DIGITS
hexadecimal digits "0123456789abcdef" as bytes in US ASCII encoding. |
| private final ConduitListener | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | FLAG_WRITES_SHUTDOWN
Flag that is set when |
| private static final int | |
| private static final byte[] | LAST_CHUNK
"0\r\n" as bytes in US ASCII encoding. |
| private PooledByteBuffer | |
| private final HeaderMap | |
| private int | |
| public static final AttachmentKey | TRAILERS
Deprecated
Trailers that are to be attached to the end of the HTTP response.
|
| Access | Constructor and Description |
|---|---|
| public | ChunkedStreamSinkConduit(final StreamSinkConduit
the channel to wrap next, final ByteBufferPool bufferPool, final boolean true to allow configuration of the next channel, false otherwisetrue to close the underlying channel when this channel is closed, false otherwiseThe response headers responseHeaders, final ConduitListener<? super ChunkedStreamSinkConduit> The finish listener finishListener, final Attachable The attachable attachable)Construct a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public void | awaitWritable()
Overrides org. Implements org. Block until this channel becomes writable again. |
| public void | awaitWritable(final long
the time to wait time, final TimeUnit the time unit timeUnit)Overrides org. Implements org. Block until this conduit becomes writable again, or until the timeout expires. |
| private void | |
| pack-priv int | |
| public boolean | flush()
Overrides org. Implements org. Flush out any unwritten, buffered output. |
| private void | |
| private static void | |
| public void | terminateWrites()
Overrides org. Implements org. Signal that no more write data is forthcoming. |
| public long | transferFrom(final FileChannel
the file to read from src, final long the position within the file from which the transfer is to begin position, final long the number of bytes to be transferred count)Overrides org. Implements org. Transfer bytes into this conduit from the given file. |
| public long | transferFrom(final StreamSourceChannel
the source to read from source, final long the number of bytes to be transferred count, final ByteBuffer the buffer to copy through. throughBuffer)Overrides org. Implements org. Transfers bytes from the given channel source. |
| public void | truncateWrites()
Overrides org. Implements org. Terminate writes and discard any outstanding write data. |
| public int | write(final ByteBuffer
the buffer containing data to write src)Overrides org. Implements org. Writes a sequence of bytes to this conduit from the given buffer. |
| public long | write(final ByteBuffer[]
the buffers containing data to write srcs, final int the offset into the buffer array offset, final int the number of buffers to write length)Overrides org. Implements org. Writes a sequence of bytes to this conduit from the given buffers. |
| public long | writeFinal(ByteBuffer[]
The buffers from which bytes are to be retrieved srcs, int The offset within the buffer array of the first buffer from
which bytes are to be retrieved; must be non-negative and no
larger than srcs.length offset, int The maximum number of buffers to be accessed; must be
non-negative and no larger than
srcs.length - offset length)Overrides org. Implements org. Writes some data to the conduit, with the same semantics as
|
| public int | writeFinal(ByteBuffer
The data to write src)Overrides org. Implements org. Writes some data to the conduit, with the same semantics as
|
| attachable | back to summary |
|---|---|
| private final Attachable attachable | |
| bufferPool | back to summary |
|---|---|
| private final ByteBufferPool bufferPool | |
| chunkingBuffer | back to summary |
|---|---|
| private final ByteBuffer chunkingBuffer | |
| chunkingSepBuffer | back to summary |
|---|---|
| private final ByteBuffer chunkingSepBuffer | |
| chunkleft | back to summary |
|---|---|
| private int chunkleft | |
| CONF_FLAG_CONFIGURABLE | back to summary |
|---|---|
| private static final int CONF_FLAG_CONFIGURABLE | |
| CONF_FLAG_PASS_CLOSE | back to summary |
|---|---|
| private static final int CONF_FLAG_PASS_CLOSE | |
| config | back to summary |
|---|---|
| private final int config | |
| CRLF | back to summary |
|---|---|
| private static final byte[] CRLF "\r\n" as bytes in US ASCII encoding. | |
| DIGITS | back to summary |
|---|---|
| private static final byte[] DIGITS hexadecimal digits "0123456789abcdef" as bytes in US ASCII encoding. | |
| finishListener | back to summary |
|---|---|
| private final ConduitListener<? super ChunkedStreamSinkConduit> finishListener | |
| FLAG_FINISHED | back to summary |
|---|---|
| private static final int FLAG_FINISHED | |
| FLAG_FIRST_DATA_WRITTEN | back to summary |
|---|---|
| private static final int FLAG_FIRST_DATA_WRITTEN | |
| FLAG_NEXT_SHUTDOWN | back to summary |
|---|---|
| private static final int FLAG_NEXT_SHUTDOWN | |
| FLAG_WRITES_SHUTDOWN | back to summary |
|---|---|
| private static final int FLAG_WRITES_SHUTDOWN Flag that is set when | |
| FLAG_WRITTEN_FIRST_CHUNK | back to summary |
|---|---|
| private static final int FLAG_WRITTEN_FIRST_CHUNK | |
| LAST_CHUNK | back to summary |
|---|---|
| private static final byte[] LAST_CHUNK "0\r\n" as bytes in US ASCII encoding. | |
| lastChunkBuffer | back to summary |
|---|---|
| private PooledByteBuffer lastChunkBuffer | |
| responseHeaders | back to summary |
|---|---|
| private final HeaderMap responseHeaders | |
| state | back to summary |
|---|---|
| private int state | |
| TRAILERS | back to summary |
|---|---|
| public static final AttachmentKey<HeaderMap> TRAILERS
Deprecated
Trailers that are to be attached to the end of the HTTP response. Note that it is the callers responsibility to make sure the client understands trailers (i.e. they have provided a TE header), and to set the 'Trailers:' header appropriately.
This attachment must be set before the | |
| ChunkedStreamSinkConduit | back to summary |
|---|---|
| public ChunkedStreamSinkConduit(final StreamSinkConduit next, final ByteBufferPool bufferPool, final boolean configurable, final boolean passClose, HeaderMap responseHeaders, final ConduitListener<? super ChunkedStreamSinkConduit> finishListener, final Attachable attachable) Construct a new instance.
| |
| awaitWritable | back to summary |
|---|---|
| public void awaitWritable() throws IOException Overrides org. Implements org. Doc from org. Block until this channel becomes writable again. This method may return spuriously before the channel becomes writable.
| |
| awaitWritable | back to summary |
|---|---|
| public void awaitWritable(final long time, final TimeUnit timeUnit) throws IOException Overrides org. Implements org. Doc from org. Block until this conduit becomes writable again, or until the timeout expires. This method may return spuriously before the conduit becomes writable or the timeout expires.
| |
| createLastChunk | back to summary |
|---|---|
| private void createLastChunk(final boolean writeFinal) throws UnsupportedEncodingException | |
| doWrite | back to summary |
|---|---|
| pack-priv int doWrite(final ByteBuffer src) throws IOException | |
| flush | back to summary |
|---|---|
| public boolean flush() throws IOException Overrides org. Implements org. Doc from org. Flush out any unwritten, buffered output.
| |
| invokeFinishListener | back to summary |
|---|---|
| private void invokeFinishListener() | |
| putIntAsHexString | back to summary |
|---|---|
| private static void putIntAsHexString(final ByteBuffer buf, final int v) | |
| terminateWrites | back to summary |
|---|---|
| public void terminateWrites() throws IOException Overrides org. Implements org. Doc from org. Signal that no more write data is forthcoming. The conduit must be
| |
| transferFrom | back to summary |
|---|---|
| public long transferFrom(final FileChannel src, final long position, final long count) throws IOException Overrides org. Implements org. Doc from org. Transfer bytes into this conduit from the given file.
| |
| transferFrom | back to summary |
|---|---|
| public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException Overrides org. Implements org. Doc from org. Transfers bytes from the given channel source. On entry,
| |
| truncateWrites | back to summary |
|---|---|
| public void truncateWrites() throws IOException Overrides org. Implements org. Doc from org. Terminate writes and discard any outstanding write data. The conduit is terminated and flushed regardless of the outcome of this method.
| |
| write | back to summary |
|---|---|
| public int write(final ByteBuffer src) throws IOException Overrides org. Implements org. Doc from org. Writes a sequence of bytes to this conduit from the given buffer.
| |
| write | back to summary |
|---|---|
| public long write(final ByteBuffer[] srcs, final int offset, final int length) throws IOException Overrides org. Implements org. Doc from org. Writes a sequence of bytes to this conduit from the given buffers.
| |
| writeFinal | back to summary |
|---|---|
| public long writeFinal(ByteBuffer[] srcs, int offset, int length) throws IOException Overrides org. Implements org. Doc from org. Writes some data to the conduit, with the same semantics as
| |
| writeFinal | back to summary |
|---|---|
| public int writeFinal(ByteBuffer src) throws IOException Overrides org. Implements org. Doc from org. Writes some data to the conduit, with the same semantics as
| |