|Constructor and Description|
|Modifier and Type||Method and Description|
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking.
Reads all remaining message body data and then close this input stream.
Reads the next byte of data from the input stream.
Reads up to
public IdentityMessageBodyInputStream(InputStream is, int bodyLength)
iswith the predefined length
bodyLengthshould be the maximum number of bytes can be read from the InputStream.
is- the underlying
InputStreamto read the body content of the HTTP message body
bodyLength- the number of bytes can be read from the underlying InputStream.
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 of data from the underlying
InputStreaminto an array of bytes. An attempt is made to read as many as
lengthbytes, but the amount of bytes can be read from the
InputStreamcould be less than
0. The number of bytes actually read are returned as an integer.
data- the byte array to store the read bytes from the underlying
offset- the starting index of byte array
datato store the bytes
length- the number of bytes intended to be read by the caller of this method
InputStream. If the end of stream has been reached, returns
IOException- thrown in the following cases:
InputStream.read(byte, int, int)