|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--java.io.PipedInputStream
PipedInputStream must be connected to a PipedOutputStream to be useful. A thread reading from a PipedInputStream recieves data from a thread writing to the PipedOutputStream it is connected to.
PipedOutputStream
Constructor Summary | |
PipedInputStream()
Creates an input file that isn't connected to anything (yet). |
|
PipedInputStream(PipedOutputStream src)
Creates an input file from the specified PiledOutputStream. |
Method Summary | |
int |
available()
Returns the number of bytes that can be read without blocking. |
void |
close()
Closes the input stream. |
void |
connect(PipedOutputStream src)
Connects this input stream to a sender. |
int |
read()
Reads a byte of data. |
int |
read(byte[] b,
int off,
int len)
Reads into an array of bytes. |
Methods inherited from class java.io.InputStream |
mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PipedInputStream(PipedOutputStream src) throws IOException
src
- the stream to connect to.public PipedInputStream()
Method Detail |
public void connect(PipedOutputStream src) throws IOException
src
- The OutputStream to connect to.
IOException
public int read() throws IOException
read
in class InputStream
IOException
- If the pipe is broken.public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
b
- the buffer into which the data is readoff
- the start offset of the datalen
- the maximum number of bytes read
IOException
- If an I/O error has occurred.public int available() throws IOException
InputStream
available
in class InputStream
IOException
public void close() throws IOException
close
in class InputStream
IOException
- If an I/O error has occurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |