public class HttpChunkedEncodingInputStream extends InputStream
InputStream wrapper also supports collecting Trailer header values that are
sent at the end of the stream.
| Constructor and Description |
|---|
HttpChunkedEncodingInputStream(InputStream in)
Wrap the given input stream.
|
HttpChunkedEncodingInputStream(InputStream in,
Map<String,List<String>> trailerHeaders)
Wrap the given input stream and store any trailing headers in the provided map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Upon close, this reads the remainder of the chunked message,
leaving the underlying socket at a position to start reading the
next response without scanning.
|
int |
read()
Reads the next byte of data from the input stream.
|
int |
read(byte[] b)
Read some bytes from the stream.
|
int |
read(byte[] b,
int off,
int len)
Read some bytes from the stream.
|
available, mark, markSupported, reset, skippublic HttpChunkedEncodingInputStream(InputStream in, Map<String,List<String>> trailerHeaders)
in - the raw input streamtrailerHeaders - Map to store any trailer header values. Can be null.public HttpChunkedEncodingInputStream(InputStream in)
in - the raw input streampublic int read()
throws IOException
int in the range 0 to
255.read in class InputStreamIOException - If an IO problem occurspublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamb - The byte array that will hold the contents from the stream.off - The offset into the byte array at which bytes will start to be placed.len - the maximum number of bytes that can be returned.IOException - if an IO problem occurs.InputStream.read(byte[], int, int)public int read(byte[] b)
throws IOException
read in class InputStreamb - The byte array that will hold the contents from the stream.IOException - if an IO problem occurs.InputStream.read(byte[])public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOException - If an IO problem occurs.Copyright © 2023. All rights reserved.