[OpenJDK 2D-Dev]  request for review: 8074954: ImageInputStreamImpl.readShort/readInt do not behave correctly at EOF
andrew.brygin at oracle.com
Fri Mar 20 11:30:49 UTC 2015
could you please review a fix for CR 8074954?
The problem happens if an input stream does not contain enough data
to read a multi-byte type (as 4-bytes integer or 2-bytes short)
completely. In this case the actual number of obtained bytes is
returned, and if we get at least one byte, the EOF exception in
As a result, an incorrect value is returned.
Suggested fix is to check explicitly whether required number of bytes
has been read.
Supplied regression test demonstrates the problem.
Please take a look.
More information about the 2d-dev