RFR 8196298 Add null Reader and Writer
Brian Burkhalter
brian.burkhalter at oracle.com
Thu Feb 1 23:16:18 UTC 2018
On Feb 1, 2018, at 12:01 PM, Patrick Reinhart <patrick at reini.net> wrote:
>> I believe read(CharBuffer), like read(char[], int, int), should test if there are remaining chars in the buffer.
>
> Does it make sense to check for remaining chars in the buffer, wen the source is basically at the end of it’s data?
read(char[], int, int) returns 0 if len == 0 and -1 otherwise.
read(CharBuffer) returns 0 if hasRemaining() is false and -1 otherwise.
The two behaviors seem consistent.
Brian
More information about the core-libs-dev
mailing list