RFR: 8268435: (ch) ChannelInputStream could override readAllBytes [v2]
Alan Bateman
alanb at openjdk.java.net
Fri Sep 24 12:44:58 UTC 2021
On Thu, 23 Sep 2021 23:45:26 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> This change would override `readAllBytes()` and `readNBytes(int)` in `ChannelInputStream` thereby improving performance for all but smaller streams.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>
> 8268435: Use instanceof pattern matching
The overrides of readAllBytes and readNBytes in ChannelInputStream look okay.
I don't have time to spend on the test right now but I wonder if we should create a new TestNG with simple tests rather than a expanding Basic.testNewInputStream with lots of cases. I can't immediately see if we have tests for an empty file, position at EOF, files > 2GB, and other cases that we might want to add.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5645
More information about the nio-dev
mailing list