public class ChunkedInputStream extends InputStream
InputStream
wrapper supporting the chunked transfer encoding.ChunkedOutputStream
Constructor and Description |
---|
ChunkedInputStream(InputStream stream)
Constructs a chunked input stream wrapping input.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying input stream.
|
MessageHeaders |
getEntityHeaders()
Returns "trailer" entity headers, which appear at the end of
a chunked encoding request.
|
boolean |
isEndChunk()
Returns true if the end chunk was read.
|
int |
read()
Reads and return a single byte from this input stream, or -1 if end of
file has been encountered.
|
int |
read(byte[] b,
int off,
int len)
Reads up to
len bytes of data from the input stream
into an array of bytes. |
String |
toString()
Returns a debug string.
|
available, mark, markSupported, read, reset, skip
public ChunkedInputStream(InputStream stream)
stream
- Must be non-null.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
len
bytes of data from the input stream
into an array of bytes. An attempt is made to read as many as
len
bytes, but a smaller number may be read,
possibly zero. The number of bytes actually read is returned as
an integer.read
in class InputStream
b
- The buffer into which the data is readoff
- The start offset into array b
at which
the data is writtenlen
- The maximum number of bytes to readIOException
- if an input/output error occurspublic int read() throws IOException
read
in class InputStream
IOException
- if an input/output error occurspublic MessageHeaders getEntityHeaders()
isEndChunk()
returns true.
See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1public boolean isEndChunk()
Copyright © 2012. All Rights Reserved.