Top Description Inners Fields Constructors Methods
org.apache.hc.core5.http.impl.nio

public Class ChunkDecoder

extends AbstractContentDecoder
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer, java.nio.channels.ReadableByteChannel, java.util.ArrayList, .List, org.apache.hc.core5.http.ConnectionClosedException, .Header, .MalformedChunkCodingException, .MessageConstraintException, .ParseException, .TruncatedChunkException, org.apache.hc.core5.http.config.Http1Config, org.apache.hc.core5.http.impl.BasicHttpTransportMetrics, org.apache.hc.core5.http.message.BufferedHeader, org.apache.hc.core5.http.nio.SessionInputBuffer, org.apache.hc.core5.util.Args, .CharArrayBuffer

Implements chunked transfer decoding. The content is received in small chunks. Entities transferred using this encoder can be of unlimited length.
Since
4.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private long
private boolean
private boolean
private final Http1Config
private CharArrayBuffer
private long
private ChunkDecoder.State
private final List<CharArrayBuffer>
private final List<Header>
Inherited from org.apache.hc.core5.http.impl.nio.AbstractContentDecoder:
bufferchannelcompletedmetrics

Constructor Summary

AccessConstructor and Description
public
ChunkDecoder(final ReadableByteChannel channel, final SessionInputBuffer buffer, final Http1Config http1Config, final BasicHttpTransportMetrics metrics)

public

Method Summary

Modifier and TypeMethod and Description
public List<? extends Header>
private void
private void
public int
read(final ByteBuffer
The buffer into which entity content is to be transferred
dst
)

Implements org.apache.hc.core5.http.nio.ContentDecoder.read.

Reads a portion of content from the underlying channel
private void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.apache.hc.core5.http.impl.nio.AbstractContentDecoder:
bufferchannelfillBufferFromChannelisCompletedmetricsreadFromChannelreadFromChannelsetCompletedsetCompleted

Field Detail

chunkSizeback to summary
private long chunkSize
endOfChunkback to summary
private boolean endOfChunk
endOfStreamback to summary
private boolean endOfStream
http1Configback to summary
private final Http1Config http1Config
lineBufback to summary
private CharArrayBuffer lineBuf
posback to summary
private long pos
stateback to summary
private ChunkDecoder.State state
trailerBufsback to summary
private final List<CharArrayBuffer> trailerBufs
trailersback to summary
private final List<Header> trailers

Constructor Detail

ChunkDecoderback to summary
public ChunkDecoder(final ReadableByteChannel channel, final SessionInputBuffer buffer, final Http1Config http1Config, final BasicHttpTransportMetrics metrics)
Since
4.4
ChunkDecoderback to summary
public ChunkDecoder(final ReadableByteChannel channel, final SessionInputBuffer buffer, final BasicHttpTransportMetrics metrics)

Method Detail

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

Overrides org.apache.hc.core5.http.impl.nio.AbstractContentDecoder.getTrailers.

Implements org.apache.hc.core5.http.nio.ContentDecoder.getTrailers.

Doc from org.apache.hc.core5.http.nio.ContentDecoder.getTrailers.

Returns content trailers if available

Returns:List<? extends Header>

list of trailers

Annotations
@Override
parseHeaderback to summary
private void parseHeader() throws IOException
processFootersback to summary
private void processFooters() throws IOException
readback to summary
public int read(final ByteBuffer dst) throws IOException

Implements org.apache.hc.core5.http.nio.ContentDecoder.read.

Doc from org.apache.hc.core5.http.nio.ContentDecoder.read.

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

Annotations
@Override
Exceptions
IOException:
if I/O error occurs while reading content
readChunkHeadback to summary
private void readChunkHead() throws IOException
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.apache.hc.core5.http.impl.nio back to summary

private final Enum ChunkDecoder.State

extends Enum<ChunkDecoder.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ChunkDecoder.State
public static final ChunkDecoder.State
public static final ChunkDecoder.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ChunkDecoder.State
public static ChunkDecoder.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

COMPLETEDback to summary
public static final ChunkDecoder.State COMPLETED
READ_CONTENTback to summary
public static final ChunkDecoder.State READ_CONTENT
READ_FOOTERSback to summary
public static final ChunkDecoder.State READ_FOOTERS

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static ChunkDecoder.State valueOf(String name)
valuesback to summary
public static ChunkDecoder.State[] values()