diff options
author | Michael Koch <konqueror@gmx.de> | 2004-11-16 11:32:35 +0000 |
---|---|---|
committer | Michael Koch <konqueror@gmx.de> | 2004-11-16 11:32:35 +0000 |
commit | cc973a12cdf4525f2307646b72728a557a1a7339 (patch) | |
tree | cb697484e66d9d532e30619ca3f2996b92d50bcd /java/io/PipedInputStream.java | |
parent | 78b829ee7adbffa4a4c4212a7538c46b8b09b894 (diff) | |
download | classpath-cc973a12cdf4525f2307646b72728a557a1a7339.tar.gz |
2004-11-16 Michael Koch <konqueror@gmx.de>
* java/io/BufferedReader.java,
java/io/FileInputStream.java,
java/io/FileOutputStream.java,
java/io/FileWriter.java,
java/io/OutputStreamWriter.java,
java/io/PipedInputStream.java,
java/io/PipedOutputStream.java,
java/io/PipedReader.java,
java/io/PipedWriter.java,
java/io/PrintStream.java,
java/io/PushbackInputStream.java,
java/io/RandomAccessFile.java,
java/io/Reader.java,
java/io/StreamTokenizer.java,
java/io/StringReader.java,
java/net/NetworkInterface.java,
java/net/URLClassLoader.java,
java/nio/ByteOrder.java,
java/nio/channels/Channel.java:
Fixed javadocs all over.
Diffstat (limited to 'java/io/PipedInputStream.java')
-rw-r--r-- | java/io/PipedInputStream.java | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/java/io/PipedInputStream.java b/java/io/PipedInputStream.java index 97700a07f..906ef10fa 100644 --- a/java/io/PipedInputStream.java +++ b/java/io/PipedInputStream.java @@ -151,14 +151,14 @@ public class PipedInputStream extends InputStream * This method receives a byte of input from the source PipedOutputStream. * If the internal circular buffer is full, this method blocks. * - * @param byte_received The byte to write to this stream + * @param val The byte to write to this stream * * @exception IOException if error occurs * @specnote Weird. This method must be some sort of accident. */ - protected synchronized void receive(int b) throws IOException + protected synchronized void receive(int val) throws IOException { - read_buf[0] = (byte) (b & 0xff); + read_buf[0] = (byte) (val & 0xff); receive (read_buf, 0, 1); } @@ -237,11 +237,7 @@ public class PipedInputStream extends InputStream * because the end of the stream was reached. If the stream is already * closed, a -1 will again be returned to indicate the end of the stream. * <p> - * This method will block if no bytes are 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. + * This method will block if no byte is available to be read. */ public int read() throws IOException { @@ -252,11 +248,7 @@ public class PipedInputStream extends InputStream // if this method is never called. int r = read(read_buf, 0, 1); - - if (r == -1) - return -1; - else - return read_buf[0]; + return r != -1 ? read_buf[0] : -1; } /** |