...
In this noncompliant code, the int
returned by the read()
method is cast directly to a char
, and that is compared with -1 to try to detect EOF
. This conversion leaves the value of c
as 0xffff (Character.MAX_VALUE, decimal 65535) instead of -1. Hence, this test never evaluates to true
.
...