@NotThreadSafe public abstract class AbstractContentEncoder extends Object implements ContentEncoder
ContentEncoder that serves as a base for all content
encoder implementations.| Modifier and Type | Field and Description |
|---|---|
protected SessionOutputBuffer |
buffer |
protected WritableByteChannel |
channel |
protected boolean |
completed |
protected HttpTransportMetricsImpl |
metrics |
| Constructor and Description |
|---|
AbstractContentEncoder(WritableByteChannel channel,
SessionOutputBuffer buffer,
HttpTransportMetricsImpl metrics)
Creates an instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertNotCompleted() |
void |
complete()
Terminates the content stream.
|
boolean |
isCompleted()
Returns
true if the entity has been transferred in its
entirety. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwriteprotected final WritableByteChannel channel
protected final SessionOutputBuffer buffer
protected final HttpTransportMetricsImpl metrics
protected boolean completed
public AbstractContentEncoder(WritableByteChannel channel, SessionOutputBuffer buffer, HttpTransportMetricsImpl metrics)
channel - the destination channel.buffer - the session output buffer that can be used to store
session data for intermediate processing.metrics - Transport metrics of the underlying HTTP transport.public boolean isCompleted()
ContentEncodertrue if the entity has been transferred in its
entirety.isCompleted in interface ContentEncodertrue if all the content has been produced,
false otherwise.public void complete()
throws IOException
ContentEncodercomplete in interface ContentEncoderIOException - if I/O error occurs while writing contentprotected void assertNotCompleted()
Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.