public class ChunkedMessageBodyInputStream extends InputStream
Each chunk starts with the number of octets of the data it embeds, expressed as a hexadecimal number in ASCII, followed by optional parameters (chunk extension) and a terminating CRLF sequence, followed by the chunk data. The chunk is terminated by CRLF. If chunk extensions are provided, the chunk size is terminated by a semicolon followed with the extension name and an optional equal sign and value. (chunk extensions are skipped).
|Constructor and Description|
Creates a new
|Modifier and Type||Method and Description|
Returns the number of available bytes to read.
Reads all remaining message body data and closes this input stream.
Reads the next byte from the InputStream used in the constructor.
Reads up to
public ChunkedMessageBodyInputStream(InputStream is)
ChunkedMessageBodyInputStreamusing the InputStream
isas the underlying data source.
is- InputStream to read from.
public int available() throws IOException
public void close() throws IOException
public int read() throws IOException
public int read(byte data, int offset, int length) throws IOException
lengthbytes to the byte array
offset. The method tries to read
lengthbytes (if there are at least
lengthbytes in the InputStream used in the constructor. Otherwise reads just the available number of bytes).
data- the byte array to store the bytes read from the underlying InputStream
offset- the position in the byte array
datato store the bytes read from the InputStream.
length- number of bytes to store in the byte array
data(if the number of bytes available in the InputStream are at least
length) If less than
lengthbytes are left in the InputStream, only the remaining bytes are stored in the byte array
data, or -1 if no bytes can be stored in the byte array
IOException- when the end of InputStream has already been reached.