diff options
author | Michael Koch <konqueror@gmx.de> | 2004-04-20 11:37:41 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2004-04-20 11:37:41 +0000 |
commit | 9f714d5eec05594569dd89920353272606622d8a (patch) | |
tree | 009937b32fd6b3926fccb11ba8049b174994633b /libjava/java/io/PushbackReader.java | |
parent | 7aebacee26b0b9f43a246e94c91ca99a150700b0 (diff) | |
download | gcc-9f714d5eec05594569dd89920353272606622d8a.zip gcc-9f714d5eec05594569dd89920353272606622d8a.tar.gz gcc-9f714d5eec05594569dd89920353272606622d8a.tar.bz2 |
BufferedWriter.java, [...]: Fixed javadocs all over, rename arguments to match javadocs, fixed coding style.
2004-04-20 Michael Koch <konqueror@gmx.de>
* java/io/BufferedWriter.java,
java/io/ByteArrayInputStream.java,
java/io/CharArrayWriter.java,
java/io/DataInput.java,
java/io/DataInputStream.java,
java/io/File.java,
java/io/FilterInputStream.java,
java/io/InputStream.java,
java/io/InputStreamReader.java,
java/io/ObjectInputStream.java,
java/io/ObjectStreamClass.java,
java/io/PipedInputStream.java,
java/io/PipedReader.java,
java/io/PushbackInputStream.java,
java/io/PushbackReader.java,
java/io/RandomAccessFile.java,
java/io/SerializablePermission.java,
java/io/StreamTokenizer.java,
java/io/StringWriter.java,
java/io/WriteAbortedException.java,
java/io/Writer.java:
Fixed javadocs all over, rename arguments to match javadocs,
fixed coding style.
From-SVN: r80897
Diffstat (limited to 'libjava/java/io/PushbackReader.java')
-rw-r--r-- | libjava/java/io/PushbackReader.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/libjava/java/io/PushbackReader.java b/libjava/java/io/PushbackReader.java index 4b442e5..cc2473a 100644 --- a/libjava/java/io/PushbackReader.java +++ b/libjava/java/io/PushbackReader.java @@ -266,33 +266,34 @@ public class PushbackReader extends FilterReader * of the chars requested, the remaining chars are read from the * underlying stream. * - * @param buf The array into which the chars read should be stored + * @param buffer The array into which the chars read should be stored * @param offset The offset into the array to start storing chars - * @param len The requested number of chars to read + * @param length The requested number of chars to read * * @return The actual number of chars read, or -1 if end of stream. * * @exception IOException If an error occurs. */ - public synchronized int read(char[] b, int offset, int len) throws IOException + public synchronized int read(char[] buffer, int offset, int length) + throws IOException { synchronized (lock) { if (buf == null) throw new IOException("stream closed"); - if (offset < 0 || len < 0 || offset + len > b.length) + if (offset < 0 || length < 0 || offset + length > buffer.length) throw new ArrayIndexOutOfBoundsException(); - int numBytes = Math.min(buf.length - pos, len); + int numBytes = Math.min(buf.length - pos, length); if (numBytes > 0) { - System.arraycopy (buf, pos, b, offset, numBytes); + System.arraycopy (buf, pos, buffer, offset, numBytes); pos += numBytes; return numBytes; } - return super.read(b, offset, len); + return super.read(buffer, offset, length); } } @@ -353,30 +354,30 @@ public class PushbackReader extends FilterReader * If the pushback buffer cannot hold all of the requested chars, an * exception is thrown. * - * @param buf The char array to be pushed back + * @param buffer The char array to be pushed back * @param offset The index into the array where the chars to be push start - * @param len The number of chars to be pushed. + * @param length The number of chars to be pushed. * * @exception IOException If the pushback buffer is full */ - public synchronized void unread(char[] b, int offset, int len) + public synchronized void unread(char[] buffer, int offset, int length) throws IOException { synchronized (lock) { if (buf == null) throw new IOException("stream closed"); - if (pos < len) + if (pos < length) throw new IOException("Pushback buffer is full"); // Note the order that these chars are being added is the opposite // of what would be done if they were added to the buffer one at a time. // See the Java Class Libraries book p. 1397. - System.arraycopy(b, offset, buf, pos - len, len); + System.arraycopy(buffer, offset, buf, pos - length, length); // Don't put this into the arraycopy above, an exception might be thrown // and in that case we don't want to modify pos. - pos -= len; + pos -= length; } } } |