public class IdentityEncoder extends AbstractContentEncoder implements FileContentEncoder
This decoder is optimized to transfer data directly from
FileChannel to the underlying I/O session's channel whenever
possible avoiding intermediate buffering in the session buffer.
|Constructor and Description|
|Modifier and Type||Method and Description|
Transfers a portion of entity content from the given file channel to the underlying network channel.
Writes a portion of entity content to the underlying channel.
assertNotCompleted, complete, flushToChannel, isCompleted, writeToBuffer, writeToChannel, writeToChannel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public IdentityEncoder(WritableByteChannel channel, SessionOutputBuffer buffer, HttpTransportMetricsImpl metrics, int fragementSizeHint)
channel- underlying channel.
buffer- session buffer.
metrics- transport metrics.
fragementSizeHint- fragment size hint defining an minimal size of a fragment that should be written out directly to the channel bypassing the session buffer. Value
0disables fragment buffering.
public int write(ByteBuffer src) throws IOException
public long transfer(FileChannel src, long position, long count) throws IOException
src- the source FileChannel to transfer data from.
position- The position within the file at which the transfer is to begin; must be non-negative
count- The maximum number of bytes to be transferred; must be non-negative
IOException- if some I/O error occurs.
Copyright © 2005–2017 The Apache Software Foundation. All rights reserved.