/[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.15.2.2 by gnu_andrew, Sun Jan 16 02:14:48 2005 UTC revision 1.15.2.3 by gnu_andrew, Sun Apr 3 00:09:10 2005 UTC
# Line 1  Line 1 
1  /* PipedInputStream.java -- Read portion of piped streams.  /* PipedInputStream.java -- Read portion of piped streams.
2     Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.     Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005  Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 226  public class PipedInputStream extends In Line 226  public class PipedInputStream extends In
226    }    }
227        
228    /**    /**
229      * This method reads bytes from the stream into a caller supplied buffer.      * This method reads one byte from the stream.
230      * It starts storing bytes at position <code>offset</code> into the      * -1 is returned to indicated that no bytes can be read
     * buffer and  
     * reads a maximum of <code>len</code> bytes.  Note that this method  
     * can actually  
     * read fewer than <code>len</code> bytes.  The actual number of bytes  
     * read is  
     * returned.  A -1 is returned to indicated that no bytes can be read  
231      * 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
232      * 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.
233      * <p>      *
234      * This method will block if no byte is available to be read.      * <p>This method will block if no byte is available to be read.</p>
235        *
236        * @return the value of the read byte value, or -1 of the end of the stream
237        * was reached
238        *
239        * @throws IOException if an error occured
240      */      */
241    public int read() throws IOException    public int read() throws IOException
242    {    {
# Line 248  public class PipedInputStream extends In Line 247  public class PipedInputStream extends In
247      // if this method is never called.      // if this method is never called.
248    
249      int r = read(read_buf, 0, 1);      int r = read(read_buf, 0, 1);
250      return r != -1 ? read_buf[0] : -1;      return r != -1 ? (read_buf[0] & 0xff) : -1;
251    }    }
252        
253    /**    /**

Legend:
Removed from v.1.15.2.2  
changed lines
  Added in v.1.15.2.3

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