diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-09-26 22:49:02 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-09-26 22:49:02 +0000 |
commit | 355bb2bf489ad9cf8492d2fe8c54b159ecf26138 (patch) | |
tree | a67635fe1caaae2feb6d589840ca369f29de3322 | |
parent | 084163dc0438b896339b4617663294854f30e371 (diff) |
* java/io/DataInputStream.java (readChar): Use readFully.
(readInt): Likewise.
(readLong): Likewise.
(readShort): Likewise.
(readUnsignedShort): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45834 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libjava/ChangeLog | 8 | ||||
-rw-r--r-- | libjava/java/io/DataInputStream.java | 20 |
2 files changed, 13 insertions, 15 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index f167739eb20..69143373bc3 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,11 @@ +2001-09-26 Tom Tromey <tromey@redhat.com> + + * java/io/DataInputStream.java (readChar): Use readFully. + (readInt): Likewise. + (readLong): Likewise. + (readShort): Likewise. + (readUnsignedShort): Likewise. + 2001-09-24 Bryce McKinlay <bryce@waitaki.otago.ac.nz> * java/lang/PosixProcess.java (exitValue): Implement here. Throw diff --git a/libjava/java/io/DataInputStream.java b/libjava/java/io/DataInputStream.java index 1607967cc66..7ed24d3df9c 100644 --- a/libjava/java/io/DataInputStream.java +++ b/libjava/java/io/DataInputStream.java @@ -173,9 +173,7 @@ public class DataInputStream extends FilterInputStream implements DataInput */ public final char readChar() throws IOException { - int count = in.read (buf, 0, 2); - if (count < 2) - throw new EOFException(); + readFully (buf, 0, 2); return convertToChar(buf); } @@ -303,9 +301,7 @@ public class DataInputStream extends FilterInputStream implements DataInput */ public final int readInt() throws IOException { - int count = in.read (buf, 0, 4); - if (count < 4) - throw new EOFException(); + readFully (buf, 0, 4); return convertToInt(buf); } @@ -453,9 +449,7 @@ public class DataInputStream extends FilterInputStream implements DataInput */ public final long readLong() throws IOException { - int count = in.read(buf, 0, 8); - if (count < 8) - throw new EOFException(); + readFully (buf, 0, 8); return convertToLong(buf); } @@ -488,9 +482,7 @@ public class DataInputStream extends FilterInputStream implements DataInput */ public final short readShort() throws IOException { - int count = in.read(buf, 0, 2); - if (count < 2) - throw new EOFException(); + readFully (buf, 0, 2); return convertToShort(buf); } @@ -542,9 +534,7 @@ public class DataInputStream extends FilterInputStream implements DataInput */ public final int readUnsignedShort() throws IOException { - int count = in.read(buf, 0, 2); - if (count < 2) - throw new EOFException(); + readFully (buf, 0, 2); return convertToUnsignedShort(buf); } |