RFR 8193832: Performance of InputStream.readAllBytes() could be improved
Alan.Bateman at oracle.com
Wed Dec 20 14:09:34 UTC 2017
On 20/12/2017 12:40, Peter Levart wrote:
> Hi Brian,
> I found another improvement. If you are reading from files, there's no
> difference. But if you read from say socket(s), there may be short
> reads (read() returning 0).
InputStreams are blocking so if someone creates an InputStream over a
socket configured non-blocking then they have to emulate blocking
behavior. So assuming a non-zero byte array, then read should return a
positive value or -1.
More information about the core-libs-dev