public interface

ContentEncoder

org.apache.http.nio.ContentEncoder
Known Indirect Subclasses

Class Overview

Abstract HTTP content encoder. HTTP content encoders can be used to apply the required coding transformation and write entity content to the underlying channel in small chunks.

Summary

Public Methods
abstract void complete()
Terminates the content stream.
abstract boolean isCompleted()
Returns true if the entity has been transferred in its entirety.
abstract int write(ByteBuffer src)
Writes a portion of entity content to the underlying channel.

Public Methods

public abstract void complete ()

Terminates the content stream.

Throws
IOException if I/O error occurs while writing content

public abstract boolean isCompleted ()

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

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

public abstract int write (ByteBuffer src)

Writes a portion of entity content to the underlying channel.

Parameters
src The buffer from which content is to be retrieved
Returns
  • The number of bytes read, possibly zero
Throws
IOException if I/O error occurs while writing content