| java.lang.Object java.io.InputStream org.cougaar.util.PipedInputStream
PipedInputStream | public class PipedInputStream extends InputStream (Code) | | An efficient replacement for java.io.PipedInputStream.
|
Constructor Summary | |
public | PipedInputStream() Creates an unconnected PipedInputStream with a default buffer size. | public | PipedInputStream(int bufSize) Creates an unconnected PipedInputStream with a specific buffer
size. | public | PipedInputStream(PipedOutputStream pos) Creates a PipedInputStream with a default buffer size connected
to the given PipedOutputStream. | public | PipedInputStream(PipedOutputStream pos, int bufSize) Creates a PipedInputStream with a specific buffer size connected
to the given PipedOutputStream. |
Method Summary | |
synchronized void | flush() Insure that everything that has been put into the stream is
available. | synchronized void | put(int b) Used by PipedOutputStream to put a byte into this stream. | synchronized void | put(byte[] b, int off, int len) Put bytes into this stream. | public synchronized int | read() Read a single byte. | public synchronized int | read(byte[] b) Read an array full of bytes. | public synchronized int | read(byte[] b, int off, int len) Read some bytes into an array. | synchronized void | setEOF() |
PipedInputStream | public PipedInputStream()(Code) | | Creates an unconnected PipedInputStream with a default buffer size.
|
PipedInputStream | public PipedInputStream(int bufSize)(Code) | | Creates an unconnected PipedInputStream with a specific buffer
size.
Parameters: bufSize - the size of the ring buffer (defaults to DEFAULT_BUFSIZE). |
PipedInputStream | public PipedInputStream(PipedOutputStream pos)(Code) | | Creates a PipedInputStream with a default buffer size connected
to the given PipedOutputStream.
Parameters: pos - the PipedOutputStream to connect to this PipedInputStream |
PipedInputStream | public PipedInputStream(PipedOutputStream pos, int bufSize)(Code) | | Creates a PipedInputStream with a specific buffer size connected
to the given PipedOutputStream.
Parameters: pos - the PipedOutputStream to connect to this PipedInputStream Parameters: bufSize - the size of the ring buffer (defaults to DEFAULT_BUFSIZE). |
flush | synchronized void flush() throws IOException(Code) | | Insure that everything that has been put into the stream is
available. Wakes the reader if the buffer is not empty.
|
put | synchronized void put(int b) throws IOException(Code) | | Used by PipedOutputStream to put a byte into this stream.
Parameters: b - the byte to put.; |
put | synchronized void put(byte[] b, int off, int len) throws IOException(Code) | | Put bytes into this stream. Used by PipedOutputStream.
Parameters: b - an array of bytes to be inserted Parameters: off - the offset in the array of the first byte to put Parameters: len - the number of bytes to put |
read | public synchronized int read() throws IOException(Code) | | Read a single byte. Waits for the byte to be available if necessary.
the next byte in the buffer as an int. |
read | public synchronized int read(byte[] b) throws IOException(Code) | | Read an array full of bytes. Always reads at least one byte. May
return with the array not completely full.
Parameters: b - the byte array to fill. the number of bytes read or -1 if eof has been reached. |
read | public synchronized int read(byte[] b, int off, int len) throws IOException(Code) | | Read some bytes into an array. Allows only a portion of an array to be filled.
Parameters: b - the array to fill Parameters: off - the offset into the array of the first byte to be read Parameters: len - the maximum number of bytes to read. the number of bytes read. If eof has been reached, -1 isreturned. if len is zero, then zero is returned. |
|
|