@NotThreadSafe public class LengthDelimitedDecoder extends AbstractContentDecoder implements FileContentDecoder
Content-Length header.
Entities transferred using this stream can be maximum Long.MAX_VALUE
long.
This decoder is optimized to transfer data directly from the underlying
I/O session's channel to a FileChannel, whenever
possible avoiding intermediate buffering in the session buffer.
buffer, channel, completed, metrics| 构造器和说明 |
|---|
LengthDelimitedDecoder(java.nio.channels.ReadableByteChannel channel,
SessionInputBuffer buffer,
HttpTransportMetricsImpl metrics,
long contentLength) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
read(java.nio.ByteBuffer dst)
Reads a portion of content from the underlying channel
|
java.lang.String |
toString() |
long |
transfer(java.nio.channels.FileChannel dst,
long position,
long count)
Transfers a portion of entity content from the underlying network channel
into the given file channel.
|
fillBufferFromChannel, isCompleted, readFromChannel, readFromChannelclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisCompletedpublic LengthDelimitedDecoder(java.nio.channels.ReadableByteChannel channel,
SessionInputBuffer buffer,
HttpTransportMetricsImpl metrics,
long contentLength)
public int read(java.nio.ByteBuffer dst)
throws java.io.IOException
ContentDecoderread 在接口中 ContentDecoderdst - The buffer into which entity content is to be transferredjava.io.IOException - if I/O error occurs while reading contentpublic long transfer(java.nio.channels.FileChannel dst,
long position,
long count)
throws java.io.IOException
FileContentDecodertransfer 在接口中 FileContentDecoderdst - the target FileChannel to transfer data into.position - The position within the file at which the transfer is to begin;
must be non-negative.
Must be less than or equal to the size of the filecount - The maximum number of bytes to be transferred; must be
non-negativejava.io.IOExceptionpublic java.lang.String toString()
toString 在类中 java.lang.Object