From 49d29bc5853695091df7b7d76f2b01f516d8b15c Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Fri, 9 May 2003 13:30:35 +0000 Subject: 2003-05-09 Michael Koch * 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. --- java/io/DataInputStream.java | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'java/io/DataInputStream.java') 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 * \r\n. These termination charaters are discarded and * are not returned as part of the string. *

+ * This method can read data that was written by an object implementing the + * writeLine() method in DataOutput. * * @return The line read as a String * * @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. *

* This method can read an unsigned byte written by an object - * implementing the writeByte() method in the + * implementing the writeUnsignedByte() method in the * DataOutput interface. * * @return The unsigned bytes value read as a Java int. @@ -599,7 +605,7 @@ public class DataInputStream extends FilterInputStream implements DataInput * The value returned is in the range of 0 to 65535. *

* This method can read an unsigned short written by an object - * implementing the writeShort() method in the + * implementing the writeUnsignedShort() method in the * DataOutput interface. * * @return The unsigned short value read as a Java int @@ -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. * -- cgit v1.2.1