Content-Length header.
Entities transferred using this stream can be maximum Long#MAX_VALUE
long.
This decoder is optimized to transfer data directly from
a FileChannel to the underlying I/O session's channel whenever
possible avoiding intermediate buffering in the session buffer.
| Modifier and Type | Field and Description |
|---|---|
| private final long | |
| private final int | |
| private long |
| Access | Constructor and Description |
|---|---|
| public | LengthDelimitedEncoder(final WritableByteChannel
underlying channel. channel, final SessionOutputBuffer session buffer. buffer, final BasicHttpTransportMetrics transport metrics. metrics, final long content length. contentLength, final int fragment size hint defining an minimal size of a fragment
that should be written out directly to the channel bypassing the session buffer.
Value chunkSizeHint)0 disables fragment buffering.
|
| public | LengthDelimitedEncoder(final WritableByteChannel channel, final SessionOutputBuffer buffer, final BasicHttpTransportMetrics metrics, final long contentLength)
|
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| public String | |
| public long | transfer(final FileChannel
the source FileChannel to transfer data from. src, final long The position within the file at which the transfer is to begin;
must be non-negative position, final long The maximum number of bytes to be transferred; must be
non-negative count)Implements org. |
| public int | write(final ByteBuffer
The buffer from which content is to be retrieved src)Implements org. |
| contentLength | back to summary |
|---|---|
| private final long contentLength | |
| fragHint | back to summary |
|---|---|
| private final int fragHint | |
| remaining | back to summary |
|---|---|
| private long remaining | |
| LengthDelimitedEncoder | back to summary |
|---|---|
public LengthDelimitedEncoder(final WritableByteChannel channel, final SessionOutputBuffer buffer, final BasicHttpTransportMetrics metrics, final long contentLength, final int chunkSizeHint)
| |
| LengthDelimitedEncoder | back to summary |
|---|---|
| public LengthDelimitedEncoder(final WritableByteChannel channel, final SessionOutputBuffer buffer, final BasicHttpTransportMetrics metrics, final long contentLength) | |
| nextChunk | back to summary |
|---|---|
| private int nextChunk(final ByteBuffer src) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| transfer | back to summary |
|---|---|
| public long transfer(final FileChannel src, final long position, final long count) throws IOException Implements org. Doc from org. Transfers a portion of entity content from the given file channel to the underlying network channel.
| |
| write | back to summary |
|---|---|
| public int write(final ByteBuffer src) throws IOException Implements org. Doc from org. Writes a portion of entity content to the underlying channel.
| |