public final class PrivateInputStream extends InputStream
Constructor and Description |
---|
PrivateInputStream(BaseStream p)
Creates an input stream for the
Operation to read from |
Modifier and Type | Method and Description |
---|---|
int |
available()
Returns the number of bytes that can be read (or skipped over) from this
input stream without blocking by the next caller of a method for this
input stream.
|
void |
close()
Closes the input stream.
|
int |
read()
Reads the next byte of data from the input stream.
|
int |
read(byte[] b)
Equivalent to
read(buffer, 0, buffer.length) . |
int |
read(byte[] b,
int offset,
int length)
Reads at most
length bytes from this stream and stores them in
the byte array b starting at offset . |
void |
writeBytes(byte[] body,
int start)
Allows the
OperationImpl thread to add body data to the
input stream. |
mark, markSupported, reset, skip
public PrivateInputStream(BaseStream p)
Operation
to read fromp
- the connection this input stream is forpublic int available() throws IOException
available
in class InputStream
IOException
- if an I/O error occurspublic int read() throws IOException
read
in class InputStream
IOException
- if an I/O error occurspublic int read(byte[] b) throws IOException
InputStream
read(buffer, 0, buffer.length)
.read
in class InputStream
IOException
public int read(byte[] b, int offset, int length) throws IOException
InputStream
length
bytes from this stream and stores them in
the byte array b
starting at offset
.read
in class InputStream
b
- the byte array in which to store the bytes read.offset
- the initial position in buffer
to store the bytes read
from this stream.length
- the maximum number of bytes to store in b
.IOException
- if the stream is closed or another IOException occurs.public void writeBytes(byte[] body, int start)
OperationImpl
thread to add body data to the
input stream.body
- the data to add to the streamstart
- the start of the body to array to copypublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
- this will never happen