RFR: 8189366: SocketInputStream.available() should check for eof

Chris Hegarty chris.hegarty at oracle.com
Wed Oct 17 11:01:55 UTC 2018


On 12/10/18 12:58, Daniel Fuchs wrote:
> ...
> 
>      int available = impl.available();
>      return eof ? 0 : available;
> 
> addresses the issue of available potentially returning garbage
> after EOF while being much less risky...

Agreed.

The above resolves the original reported potential bug,
without changing existing long-standing behavior.

Vyom, can you please proceed with the aboves source
change, and also update the existing CloseAvailable.java
to add additional coverage for this scenario.

Thanks,
-Chris.


More information about the net-dev mailing list