Top Description Methods
org.apache.hc.core5.http.nio

public Interface ContentEncoder

Known Direct Subinterfaces
org.apache.hc.core5.http.nio.FileContentEncoder, org.apache.hc.core5.http.impl.nio.Http1StreamChannel
Known Direct Implementers
org.apache.hc.core5.http.impl.nio.AbstractContentEncoder
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.List, org.apache.hc.core5.http.Header

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.
Since
4.0

Method Summary

Modifier and TypeMethod and Description
public void
complete(List<? extends Header> trailers)

Terminates the content stream.

public boolean

Returns:

true if all the content has been produced, false otherwise.
isCompleted
()

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

public int

Returns:

The number of bytes read, possibly zero
write
(ByteBuffer
The buffer from which content is to be retrieved
src
)

Writes a portion of entity content to the underlying channel.

Method Detail

completeback to summary
public void complete(List<? extends Header> trailers) throws IOException

Terminates the content stream.

Exceptions
IOException:
if I/O error occurs while writing content
isCompletedback to summary
public boolean isCompleted()

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

Returns:boolean

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

writeback to summary
public int write(ByteBuffer src) throws IOException

Writes a portion of entity content to the underlying channel.

Parameters
src:ByteBuffer

The buffer from which content is to be retrieved

Returns:int

The number of bytes read, possibly zero

Exceptions
IOException:
if I/O error occurs while writing content