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

Brian Burkhalter brian.burkhalter at oracle.com
Tue Dec 19 23:22:51 UTC 2017


On Dec 19, 2017, at 2:36 PM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:

>> You can also simplify the “for(;;) + break" into a do while loop:
>> 
>> do {
>>  int nread = 0;
>>  ...
>> } while (n > 0);
> 
> Good suggestion but I think that this needs to be "while (n >= 0)."

Updated version here:

http://cr.openjdk.java.net/~bpb/8193832/webrev.02/

Thanks,

Brian


More information about the core-libs-dev mailing list