diff options
author | Michael Koch <konqueror@gmx.de> | 2003-05-09 13:30:35 +0000 |
---|---|---|
committer | Michael Koch <konqueror@gmx.de> | 2003-05-09 13:30:35 +0000 |
commit | 49d29bc5853695091df7b7d76f2b01f516d8b15c (patch) | |
tree | 384948977e07c58cedff7845017ad913b92ab6c1 /java/io/DataInputStream.java | |
parent | cd2dc30d336ccf84e81067785b3fb67353c0782d (diff) | |
download | classpath-49d29bc5853695091df7b7d76f2b01f516d8b15c.tar.gz |
2003-05-09 Michael Koch <konqueror@gmx.de>
* java/io/BufferedOutputStream.java
(close): New method merged from libgcj.
(finalize): Likewise.
* java/io/DataInputStream.java
(readChar): Reformatted.
(readInt): Likewise.
(readLine): Merged documentation from libgcj.
(readUnsignedByte): Likewise.
(readUnsignedShort): Likewise.
(skip): Likewise.
* java/io/InputStreamReader.java
(read): Merged documentation from libgcj, reformatted.
* java/io/OutputStreamWriter.java
(OutputStreamWriter): Merged class documentation with libgcj.
(OutputStreamWriter): Reformatted.
(close): Likewise.
(getEncoding): Likewise.
(flush): Likewise.
(write): Merged with libgcj.
Diffstat (limited to 'java/io/DataInputStream.java')
-rw-r--r-- | java/io/DataInputStream.java | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/java/io/DataInputStream.java b/java/io/DataInputStream.java index c26e08394..33cb8b0f7 100644 --- a/java/io/DataInputStream.java +++ b/java/io/DataInputStream.java @@ -189,7 +189,7 @@ public class DataInputStream extends FilterInputStream implements DataInput * * @see DataOutput#writeChar */ - public synchronized final char readChar() throws IOException + public synchronized final char readChar () throws IOException { readFully (buf, 0, 2); return (char) ((buf[0] << 8) | (buf[1] & 0xff)); @@ -254,7 +254,7 @@ public class DataInputStream extends FilterInputStream implements DataInput * In this case, the method will return immediately without reading any * bytes from the stream. * - * @param buf The buffer into which to read the data + * @param b The buffer into which to read the data * * @exception EOFException If end of file is reached before filling the * buffer @@ -324,11 +324,13 @@ public class DataInputStream extends FilterInputStream implements DataInput * * @see DataOutput#writeInt */ - public synchronized final int readInt() throws IOException + public synchronized final int readInt () throws IOException { readFully (buf, 0, 4); - return (((buf[0] & 0xff) << 24) | ((buf[1] & 0xff) << 16) | - ((buf[2] & 0xff) << 8) | (buf[3] & 0xff)); + return (((buf[0] & 0xff) << 24) | + ((buf[1] & 0xff) << 16) | + ((buf[2] & 0xff) << 8) | + (buf[3] & 0xff)); } /** @@ -346,11 +348,15 @@ public class DataInputStream extends FilterInputStream implements DataInput * <code>\r\n</code>. These termination charaters are discarded and * are not returned as part of the string. * <p> + * This method can read data that was written by an object implementing the + * <code>writeLine()</code> method in <code>DataOutput</code>. * * @return The line read as a <code>String</code> * * @exception IOException If an error occurs * + * @see DataOutput + * * @deprecated */ public final String readLine() throws IOException @@ -471,7 +477,7 @@ public class DataInputStream extends FilterInputStream implements DataInput * * @see DataOutput#writeLong */ - public synchronized final long readLong() throws IOException + public synchronized final long readLong () throws IOException { readFully (buf, 0, 8); return (((long)(buf[0] & 0xff) << 56) | @@ -523,7 +529,7 @@ public class DataInputStream extends FilterInputStream implements DataInput * 255. * <p> * This method can read an unsigned byte written by an object - * implementing the <code>writeByte()</code> method in the + * implementing the <code>writeUnsignedByte()</code> method in the * <code>DataOutput</code> interface. * * @return The unsigned bytes value read as a Java <code>int</code>. @@ -599,7 +605,7 @@ public class DataInputStream extends FilterInputStream implements DataInput * The value returned is in the range of 0 to 65535. * <p> * This method can read an unsigned short written by an object - * implementing the <code>writeShort()</code> method in the + * implementing the <code>writeUnsignedShort()</code> method in the * <code>DataOutput</code> interface. * * @return The unsigned short value read as a Java <code>int</code> @@ -736,7 +742,7 @@ public class DataInputStream extends FilterInputStream implements DataInput * This method will not skip any bytes if passed a negative number of bytes * to skip. * - * @param numBytes The requested number of bytes to skip. + * @param n The requested number of bytes to skip. * * @return The requested number of bytes to skip. * |