src/java.desktop/share/classes/javax/imageio/stream/ImageInputStreamImpl.java
Print this page
@@ -223,11 +223,11 @@
}
return ch;
}
public short readShort() throws IOException {
- if (read(byteBuf, 0, 2) < 0) {
+ if (read(byteBuf, 0, 2) != 2) {
throw new EOFException();
}
if (byteOrder == ByteOrder.BIG_ENDIAN) {
return (short)
@@ -245,11 +245,11 @@
public char readChar() throws IOException {
return (char)readShort();
}
public int readInt() throws IOException {
- if (read(byteBuf, 0, 4) < 0) {
+ if (read(byteBuf, 0, 4) != 4) {
throw new EOFException();
}
if (byteOrder == ByteOrder.BIG_ENDIAN) {
return