This class is an
InputStream that implements one half of a pipe and
is useful for communication between
threads. A
PipedInputStream must be connected to a
PipedOutputStream object, which may be specified
when the PipedInputStream is created or with the
connect( )
method. Data read from a PipedInputStream object
is received from the PipedOutputStream to which it
is connected. See InputStream for information on
the low-level methods for reading data from a
PipedInputStream. A
FilterInputStream can provide a higher-level
interface for reading data from a
PipedInputStream.
Figure 9-45. java.io.PipedInputStream
public class
PipedInputStream extends InputStream {
// Public Constructors
public
PipedInputStream ( );
public
PipedInputStream (PipedOutputStream
src ) throws IOException;
// Protected Constants
1.1 protected static final int
PIPE_SIZE ; =1024
// Public Instance Methods
public void
connect (PipedOutputStream
src ) throws IOException;
// Public Methods Overriding InputStream
public int
available ( ) throws IOException; synchronized
public void
close ( ) throws IOException;
public int
read ( ) throws IOException; synchronized
public int
read (byte[ ]
b , int
off , int
len ) throws IOException; synchronized
// Protected Instance Methods
1.1 protected void
receive (int
b ) throws IOException; synchronized
// Protected Instance Fields
1.1 protected byte[ ]
buffer ;
1.1 protected int
in ;
1.1 protected int
out ;
}