On Feb 1, 2018, at 12:01 PM, Patrick Reinhart <[email protected]> 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

Reply via email to