/[classpath]/classpath/java/io/PipedInputStream.java
ViewVC logotype

Diff of /classpath/java/io/PipedInputStream.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by mkoch, Sat Oct 2 08:44:39 2004 UTC revision 1.17 by mkoch, Tue Nov 16 11:32:36 2004 UTC
# Line 151  public class PipedInputStream extends In Line 151  public class PipedInputStream extends In
151    * This method receives a byte of input from the source PipedOutputStream.    * This method receives a byte of input from the source PipedOutputStream.
152    * If the internal circular buffer is full, this method blocks.    * If the internal circular buffer is full, this method blocks.
153    *    *
154    * @param byte_received The byte to write to this stream    * @param val The byte to write to this stream
155    *    *
156    * @exception IOException if error occurs    * @exception IOException if error occurs
157    * @specnote Weird. This method must be some sort of accident.    * @specnote Weird. This method must be some sort of accident.
158    */    */
159    protected synchronized void receive(int b) throws IOException    protected synchronized void receive(int val) throws IOException
160    {    {
161      read_buf[0] = (byte) (b & 0xff);      read_buf[0] = (byte) (val & 0xff);
162      receive (read_buf, 0, 1);      receive (read_buf, 0, 1);
163    }    }
164    
# Line 237  public class PipedInputStream extends In Line 237  public class PipedInputStream extends In
237      * because the end of the stream was reached.  If the stream is already      * because the end of the stream was reached.  If the stream is already
238      * closed, a -1 will again be returned to indicate the end of the stream.      * closed, a -1 will again be returned to indicate the end of the stream.
239      * <p>      * <p>
240      * This method will block if no bytes are available to be read.      * This method will block if no byte is available to be read.
     *  
     * @param buf The buffer into which bytes will be stored  
     * @param offset The index into the buffer at which to start writing.  
     * @param len The maximum number of bytes to read.  
241      */      */
242    public int read() throws IOException    public int read() throws IOException
243    {    {
# Line 252  public class PipedInputStream extends In Line 248  public class PipedInputStream extends In
248      // if this method is never called.      // if this method is never called.
249    
250      int r = read(read_buf, 0, 1);      int r = read(read_buf, 0, 1);
251        return r != -1 ? read_buf[0] : -1;
     if (r == -1)  
       return -1;  
     else  
       return read_buf[0];  
252    }    }
253        
254    /**    /**

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26