public abstract class

AbstractContentEncoder

extends Object
implements ContentEncoder
java.lang.Object
   ↳ org.apache.http.impl.nio.codecs.AbstractContentEncoder
Known Direct Subclasses

Class Overview

Abstract ContentEncoder that serves as a base for all content encoder implementations.

Summary

Fields
protected final SessionOutputBuffer buffer
protected final WritableByteChannel channel
protected boolean completed
protected final HttpTransportMetricsImpl metrics
Public Constructors
AbstractContentEncoder(WritableByteChannel channel, SessionOutputBuffer buffer, HttpTransportMetricsImpl metrics)
Creates an instance of this class.
Public Methods
void complete()
Terminates the content stream.
boolean isCompleted()
Returns true if the entity has been transferred in its entirety.
Protected Methods
void assertNotCompleted()
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.nio.ContentEncoder

Fields

protected final SessionOutputBuffer buffer

protected final WritableByteChannel channel

protected boolean completed

protected final HttpTransportMetricsImpl metrics

Public Constructors

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.

Public Methods

public void complete ()

Terminates the content stream.

Throws
IOException

public boolean isCompleted ()

Returns true if the entity has been transferred in its entirety.

Returns
  • true if all the content has been produced, false otherwise.

Protected Methods

protected void assertNotCompleted ()