ContentEncoder that serves as a base for all content
encoder implementations.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final SessionOutputBuffer | |
| pack-priv final WritableByteChannel | |
| pack-priv boolean | |
| pack-priv final BasicHttpTransportMetrics |
| Access | Constructor and Description |
|---|---|
| public | AbstractContentEncoder(final WritableByteChannel
the destination channel. channel, final SessionOutputBuffer the session output buffer that can be used to store
session data for intermediate processing. buffer, final BasicHttpTransportMetrics Transport metrics of the underlying HTTP transport. metrics)Creates an instance of this class. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected SessionOutputBuffer | |
| protected WritableByteChannel | |
| public void | complete(final List<? extends Header> trailers)
Implements org. |
| public final void | |
| private int | |
| private int | |
| protected int | Returns: number of bytes written to the channel.Flushes content of the session buffer to the channel and updates transport metrics. |
| public boolean | isCompleted()
Implements org. true if the entity has been transferred in its
entirety.
|
| protected BasicHttpTransportMetrics | |
| protected int | Returns: number of bytes transferred.source. src, final int max number of bytes to transfer. limit)Transfers content of the source to the buffer and updates transport metrics. |
| protected int | Returns: number of bytes written to the channel.Flushes content of the given buffer to the channel and updates transport metrics. |
| protected int | Returns: number of bytes transferred.source. src, final int max number of bytes to transfer. limit)Transfers content of the source to the channel and updates transport metrics. |
| buffer | back to summary |
|---|---|
| pack-priv final SessionOutputBuffer buffer | |
| channel | back to summary |
|---|---|
| pack-priv final WritableByteChannel channel | |
| completed | back to summary |
|---|---|
| pack-priv boolean completed | |
| metrics | back to summary |
|---|---|
| pack-priv final BasicHttpTransportMetrics metrics | |
| AbstractContentEncoder | back to summary |
|---|---|
| public AbstractContentEncoder(final WritableByteChannel channel, final SessionOutputBuffer buffer, final BasicHttpTransportMetrics metrics) Creates an instance of this class.
| |
| assertNotCompleted | back to summary |
|---|---|
| protected void assertNotCompleted() | |
| buffer | back to summary |
|---|---|
| protected SessionOutputBuffer buffer() | |
| channel | back to summary |
|---|---|
| protected WritableByteChannel channel() | |
| complete | back to summary |
|---|---|
| public void complete(final List<? extends Header> trailers) throws IOException Implements org. Doc from org. Terminates the content stream.
| |
| complete | back to summary |
|---|---|
| public final void complete() throws IOException | |
| doWriteChunk | back to summary |
|---|---|
| private int doWriteChunk(final ByteBuffer src, final int chunk, final boolean direct) throws IOException | |
| doWriteChunk | back to summary |
|---|---|
| private int doWriteChunk(final ByteBuffer src, final boolean direct) throws IOException | |
| flushToChannel | back to summary |
|---|---|
| protected int flushToChannel() throws IOException Flushes content of the session buffer to the channel and updates transport metrics.
| |
| isCompleted | back to summary |
|---|---|
| public boolean isCompleted() Implements org. Doc from org. Returns
| |
| metrics | back to summary |
|---|---|
| protected BasicHttpTransportMetrics metrics() | |
| writeToBuffer | back to summary |
|---|---|
| protected int writeToBuffer(final ByteBuffer src, final int limit) throws IOException Transfers content of the source to the buffer and updates transport metrics.
| |
| writeToChannel | back to summary |
|---|---|
| protected int writeToChannel(final ByteBuffer src) throws IOException Flushes content of the given buffer to the channel and updates transport metrics.
| |
| writeToChannel | back to summary |
|---|---|
| protected int writeToChannel(final ByteBuffer src, final int limit) throws IOException Transfers content of the source to the channel and updates transport metrics.
| |