public class ChunkEncoder extends AbstractContentEncoder
Modifier and Type | Field and Description |
---|---|
private BufferInfo |
bufferinfo |
private int |
fragHint |
private CharArrayBuffer |
lineBuffer |
buffer, channel, completed, metrics
Constructor and Description |
---|
ChunkEncoder(WritableByteChannel channel,
SessionOutputBuffer buffer,
HttpTransportMetricsImpl metrics) |
ChunkEncoder(WritableByteChannel channel,
SessionOutputBuffer buffer,
HttpTransportMetricsImpl metrics,
int fragementSizeHint) |
Modifier and Type | Method and Description |
---|---|
void |
complete()
Terminates the content stream.
|
String |
toString() |
int |
write(ByteBuffer src)
Writes a portion of entity content to the underlying channel.
|
assertNotCompleted, flushToChannel, isCompleted, writeToBuffer, writeToChannel, writeToChannel
private final int fragHint
private final CharArrayBuffer lineBuffer
private final BufferInfo bufferinfo
public ChunkEncoder(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 0
disables fragment buffering.public ChunkEncoder(WritableByteChannel channel, SessionOutputBuffer buffer, HttpTransportMetricsImpl metrics)
public int write(ByteBuffer src) throws IOException
ContentEncoder
src
- The buffer from which content is to be retrievedIOException
- if I/O error occurs while writing contentpublic void complete() throws IOException
ContentEncoder
complete
in interface ContentEncoder
complete
in class AbstractContentEncoder
IOException
- if I/O error occurs while writing contentWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses