Package org.apache.http.impl.nio.codecs
Class AbstractContentEncoder
- java.lang.Object
-
- org.apache.http.impl.nio.codecs.AbstractContentEncoder
-
- All Implemented Interfaces:
ContentEncoder
- Direct Known Subclasses:
ChunkEncoder,IdentityEncoder,LengthDelimitedEncoder
public abstract class AbstractContentEncoder extends java.lang.Object implements ContentEncoder
AbstractContentEncoderthat serves as a base for all content encoder implementations.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description AbstractContentEncoder(java.nio.channels.WritableByteChannel channel, SessionOutputBuffer buffer, HttpTransportMetricsImpl metrics)Creates an instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplete()Terminates the content stream.booleanisCompleted()Returnstrueif the entity has been transferred in its entirety.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.http.nio.ContentEncoder
write
-
-
-
-
Constructor Detail
-
AbstractContentEncoder
public AbstractContentEncoder(java.nio.channels.WritableByteChannel channel, SessionOutputBuffer buffer, HttpTransportMetricsImpl metrics)Creates an instance of this class.- Parameters:
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.
-
-
Method Detail
-
isCompleted
public boolean isCompleted()
Description copied from interface:ContentEncoderReturnstrueif the entity has been transferred in its entirety.- Specified by:
isCompletedin interfaceContentEncoder- Returns:
trueif all the content has been produced,falseotherwise.
-
complete
public void complete() throws java.io.IOExceptionDescription copied from interface:ContentEncoderTerminates the content stream.- Specified by:
completein interfaceContentEncoder- Throws:
java.io.IOException- if I/O error occurs while writing content
-
-