<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.io.PipedInputStream
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.io.html">This Package</a>  <a href="java.io.OutputStreamWriter.html#_top_">Previous</a>  <a href="java.io.PipedOutputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.io.PipedInputStream
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.io.InputStream.html#_top_">java.io.InputStream</a>
           |
           +----java.io.PipedInputStream
</pre>
<hr>
<dl>
  <dt> public class <b>PipedInputStream</b>
  <dt> extends <a href="java.io.InputStream.html#_top_">InputStream</a>
</dl>
A piped input stream is the receiving end of a communications 
 pipe. Two threads can communicate by having one thread send data 
 through a piped output stream and having the other thread read the 
 data through a piped input stream.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.PipedOutputStream.html#_top_">PipedOutputStream</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#buffer"><b>buffer</b></a>
  <dd>  The circular buffer into which incoming data is placed.
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#in"><b>in</b></a>
  <dd>  
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#out"><b>out</b></a>
  <dd>  
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#PIPE_SIZE"><b>PIPE_SIZE</b></a>
  <dd>  
</dl>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#PipedInputStream()"><b>PipedInputStream</b></a>()
  <dd>  Creates a piped input stream that is not yet connected to a piped 
 output stream.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#PipedInputStream(java.io.PipedOutputStream)"><b>PipedInputStream</b></a>(PipedOutputStream)
  <dd>  Creates a piped input stream connected to the specified piped 
 output stream.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#available()"><b>available</b></a>()
  <dd>  Returns the number of bytes that can be read from this input 
 stream without blocking.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#close()"><b>close</b></a>()
  <dd>  Closes this piped input stream and releases any system resources 
 associated with the stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#connect(java.io.PipedOutputStream)"><b>connect</b></a>(PipedOutputStream)
  <dd>  Connects this piped input stream to a sender.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#read()"><b>read</b></a>()
  <dd>  Reads the next byte of data from this piped input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#read(byte[], int, int)"><b>read</b></a>(byte[], int, int)
  <dd>  Reads up to <code>len</code> bytes of data from this piped input 
 stream into an array of bytes.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#receive(int)"><b>receive</b></a>(int)
  <dd>  Receives a byte of data.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="PIPE_SIZE"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>PIPE_SIZE</b>
<pre>
 protected static final int PIPE_SIZE
</pre>
<dl>
</dl>
<a name="buffer"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>buffer</b>
<pre>
 protected byte buffer[]
</pre>
<dl>
  <dd> The circular buffer into which incoming data is placed.<p>
</dl>
<a name="in"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>in</b>
<pre>
 protected int in
</pre>
<dl>
</dl>
<a name="out"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>out</b>
<pre>
 protected int out
</pre>
<dl>
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="PipedInputStream"></a>
<a name="PipedInputStream(java.io.PipedOutputStream)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>PipedInputStream</b>
<pre>
 public PipedInputStream(<a href="java.io.PipedOutputStream.html#_top_">PipedOutputStream</a> src) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Creates a piped input stream connected to the specified piped 
 output stream.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> src - the stream to connect to.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs.
  </dl></dd>
</dl>
<a name="PipedInputStream()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>PipedInputStream</b>
<pre>
 public PipedInputStream()
</pre>
<dl>
  <dd> Creates a piped input stream that is not yet connected to a piped 
 output stream. It must be connected to a piped output stream, 
 either by the receiver or the sender, before being used.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#connect(java.io.PipedOutputStream)">connect</a>, <a href="java.io.PipedOutputStream.html#connect(java.io.PipedInputStream)">connect</a>
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="connect(java.io.PipedOutputStream)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="connect"><b>connect</b></a>
<pre>
 public void connect(<a href="java.io.PipedOutputStream.html#_top_">PipedOutputStream</a> src) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Connects this piped input stream to a sender.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> src - The piped output stream to connect to.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs.
  </dl></dd>
</dl>
<a name="receive(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="receive"><b>receive</b></a>
<pre>
 protected synchronized void receive(int b) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Receives a byte of data.  This method will block if no input is
 available.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the byte being received
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> If the pipe is broken.
  </dl></dd>
</dl>
<a name="read()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="read"><b>read</b></a>
<pre>
 public synchronized int read() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads the next byte of data from this piped input stream. The 
 value byte is returned as an <code>int</code> in the range 
 <code>0</code> to <code>255</code>. If no byte is available 
 because this end of the stream has been reached, the value 
 <code>-1</code> is returned. This method blocks until input data 
 is available, the end of the stream is detected, or an exception 
 is thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the next byte of data, or <code>-1</code> if the end of the
             stream is reached.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if the pipe is broken.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.InputStream.html#read()">read</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
  </dl></dd>
</dl>
<a name="read(byte[], int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="read"><b>read</b></a>
<pre>
 public synchronized int read(byte b[],
                              int off,
                              int len) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads up to <code>len</code> bytes of data from this piped input 
 stream into an array of bytes. This method blocks until at least one
 byte of input is available.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the buffer into which the data is read.
    <dd> off - the start offset of the data.
    <dd> len - the maximum number of bytes read.
    <dt> <b>Returns:</b>
    <dd> the total number of bytes read into the buffer, or
             <code>-1</code> if there is no more data because the end of
             the stream has been reached.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.InputStream.html#read(byte[], int, int)">read</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
  </dl></dd>
</dl>
<a name="available()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="available"><b>available</b></a>
<pre>
 public synchronized int available() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Returns the number of bytes that can be read from this input 
 stream without blocking. This method overrides the <code>available</code>
 method of the parent class.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the number of bytes that can be read from this input stream
             without blocking.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.InputStream.html#available()">available</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
  </dl></dd>
</dl>
<a name="close()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="close"><b>close</b></a>
<pre>
 public void close() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Closes this piped input stream and releases any system resources 
 associated with the stream.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.InputStream.html#close()">close</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.io.html">This Package</a>  <a href="java.io.OutputStreamWriter.html#_top_">Previous</a>  <a href="java.io.PipedOutputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
