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 Object
- implements ContentEncoder
Abstract ContentEncoder
that serves as a base for all content
encoder implementations.
- Since:
- 4.0
- Version:
- $Revision: 744538 $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
channel
protected final WritableByteChannel channel
buffer
protected final SessionOutputBuffer buffer
metrics
protected final HttpTransportMetricsImpl metrics
completed
protected boolean completed
AbstractContentEncoder
public AbstractContentEncoder(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.
isCompleted
public boolean isCompleted()
- Description copied from interface:
ContentEncoder
- Returns
true
if the entity has been transferred in its
entirety.
- Specified by:
isCompleted
in interface ContentEncoder
- Returns:
true
if all the content has been produced,
false
otherwise.
complete
public void complete()
throws IOException
- Description copied from interface:
ContentEncoder
- Terminates the content stream.
- Specified by:
complete
in interface ContentEncoder
- Throws:
IOException
- if I/O error occurs while writing content
assertNotCompleted
protected void assertNotCompleted()
Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.