@NotThreadSafe public class IdentityDecoder extends AbstractContentDecoder implements FileContentDecoder
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| 构造器和说明 |
|---|
IdentityDecoder(java.nio.channels.ReadableByteChannel channel,
SessionInputBuffer buffer,
HttpTransportMetricsImpl metrics) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
read(java.nio.ByteBuffer dst)
Reads a portion of content from the underlying channel
|
void |
setCompleted(boolean completed)
Sets the completed status of this decoder.
|
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 IdentityDecoder(java.nio.channels.ReadableByteChannel channel,
SessionInputBuffer buffer,
HttpTransportMetricsImpl metrics)
public void setCompleted(boolean completed)
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