RFR 8193832: Performance of InputStream.readAllBytes() could be improved

Brian Burkhalter brian.burkhalter at oracle.com
Thu Dec 21 18:45:23 UTC 2017

Hi Peter,

On Dec 21, 2017, at 10:26 AM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:

> What about the case where read() returns 0, e.g., when reading from a socket, but subsequent reads return positive values?
>            // read to EOF which may read more or less than buffer size
>            while ((n = read(buf, nread, buf.length - nread)) > 0) {
>                nread += n;
>            }
> Then it does not look as if buffer is full or am I mistaken?

Never mind, I think I am mistaken.



More information about the core-libs-dev mailing list