Class ChunkDecoder
- java.lang.Object
-
- org.apache.hc.core5.http.impl.nio.AbstractContentDecoder
-
- org.apache.hc.core5.http.impl.nio.ChunkDecoder
-
- All Implemented Interfaces:
ContentDecoder
public class ChunkDecoder extends AbstractContentDecoder
Implements chunked transfer decoding. The content is received in small chunks. Entities transferred using this encoder can be of unlimited length.- Since:
- 4.0
-
-
Field Summary
-
Fields inherited from class org.apache.hc.core5.http.impl.nio.AbstractContentDecoder
completed
-
-
Constructor Summary
Constructors Constructor Description ChunkDecoder(java.nio.channels.ReadableByteChannel channel, SessionInputBuffer buffer, Http1Config http1Config, BasicHttpTransportMetrics metrics)ChunkDecoder(java.nio.channels.ReadableByteChannel channel, SessionInputBuffer buffer, BasicHttpTransportMetrics metrics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<? extends Header>getTrailers()Returns content trailers if availableintread(java.nio.ByteBuffer dst)Reads a portion of content from the underlying channeljava.lang.StringtoString()-
Methods inherited from class org.apache.hc.core5.http.impl.nio.AbstractContentDecoder
buffer, channel, fillBufferFromChannel, isCompleted, metrics, readFromChannel, readFromChannel, setCompleted, setCompleted
-
-
-
-
Constructor Detail
-
ChunkDecoder
public ChunkDecoder(java.nio.channels.ReadableByteChannel channel, SessionInputBuffer buffer, Http1Config http1Config, BasicHttpTransportMetrics metrics)- Since:
- 4.4
-
ChunkDecoder
public ChunkDecoder(java.nio.channels.ReadableByteChannel channel, SessionInputBuffer buffer, BasicHttpTransportMetrics metrics)
-
-
Method Detail
-
read
public int read(java.nio.ByteBuffer dst) throws java.io.IOExceptionDescription copied from interface:ContentDecoderReads a portion of content from the underlying channel- Parameters:
dst- The buffer into which entity content is to be transferred- Returns:
- The number of bytes read, possibly zero, or -1 if the channel has reached end-of-stream
- Throws:
java.io.IOException- if I/O error occurs while reading content
-
getTrailers
public java.util.List<? extends Header> getTrailers()
Description copied from interface:ContentDecoderReturns content trailers if available- Specified by:
getTrailersin interfaceContentDecoder- Overrides:
getTrailersin classAbstractContentDecoder- Returns:
- list of trailers
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-