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

public Interface ContentDecoder

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

Abstract HTTP content decoder. HTTP content decoders can be used to read entity content from the underlying channel in small chunks and apply the required coding transformation.
Since
4.0

Method Summary

Modifier and TypeMethod and Description
public List<? extends Header>

Returns:

list of trailers
getTrailers
()

Returns content trailers if available

public boolean

Returns:

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

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

public int

Returns:

The number of bytes read, possibly zero, or -1 if the channel has reached end-of-stream
read
(ByteBuffer
The buffer into which entity content is to be transferred
dst
)

Reads a portion of content from the underlying channel

Method Detail

getTrailersback to summary
public List<? extends Header> getTrailers()

Returns content trailers if available

Returns:List<? extends Header>

list of trailers

Since
5.0
isCompletedback to summary
public boolean isCompleted()

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

Returns:boolean

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

readback to summary
public int read(ByteBuffer dst) throws IOException

Reads a portion of content from the underlying channel

Parameters
dst:ByteBuffer

The buffer into which entity content is to be transferred

Returns:int

The number of bytes read, possibly zero, or -1 if the channel has reached end-of-stream

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