summaryrefslogtreecommitdiff
path: root/java/io/DataInputStream.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-09-26 22:46:51 +0000
committerTom Tromey <tromey@redhat.com>2001-09-26 22:46:51 +0000
commit1c0e65685f92d7d42469987b2c90d03a236ba5d5 (patch)
treedc9de246fe2417db62bd7ab3e7954b2ecea4a287 /java/io/DataInputStream.java
parentfa260dfd99f3e978056ac222a473b11e48db7e68 (diff)
downloadclasspath-1c0e65685f92d7d42469987b2c90d03a236ba5d5.tar.gz
* java/io/DataInputStream.java (readChar): Use readFully.
(readInt): Likewise. (readLong): Likewise. (readShort): Likewise. (readUnsignedShort): Likewise.
Diffstat (limited to 'java/io/DataInputStream.java')
-rw-r--r--java/io/DataInputStream.java20
1 files changed, 5 insertions, 15 deletions
diff --git a/java/io/DataInputStream.java b/java/io/DataInputStream.java
index 1607967cc..7ed24d3df 100644
--- a/java/io/DataInputStream.java
+++ b/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);
}