8212114: Reconsider the affect on closed streams resulting from 8189366

Reviewed-by: chegar, dfuchs
This commit is contained in:
Vyom Tewari 2018-10-22 15:20:43 +05:30
parent 21341a37af
commit 3bafe65a75
2 changed files with 40 additions and 5 deletions

View file

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