8189366: SocketInputStream.available() should check for eof

Reviewed-by: chegar
This commit is contained in:
Vyom Tewari 2018-10-12 12:37:13 +05:30
parent 1d8a27195c
commit f4df5cb4c3
2 changed files with 66 additions and 19 deletions

View file

@ -232,7 +232,11 @@ class SocketInputStream extends FileInputStream {
* @return the number of immediately available bytes
*/
public int available() throws IOException {
return impl.available();
if (eof) {
return 0;
} else {
return impl.available();
}
}
/**