RFR: 8268435: (ch) ChannelInputStream could override readAllBytes [v4]
Lance Andersen
lancea at openjdk.java.net
Fri Oct 1 11:09:33 UTC 2021
On Wed, 29 Sep 2021 22:32:09 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: Split up @Tests into multiple, smaller @Tests
Hi Brian,
Looks good overall. A couple minor suggestions for you to consider but I am good to go either way.
test/jdk/java/nio/channels/Channels/ReadXBytes.java line 64:
> 62: private static final int BIG_LENGTH = ArraysSupport.SOFT_MAX_ARRAY_LENGTH;
> 63: private static final long HUGE_LENGTH = Integer.MAX_VALUE + 27L;
> 64:
Perhaps consider adding a comment for the above length constants
test/jdk/java/nio/channels/Channels/ReadXBytes.java line 233:
> 231: assertEquals(bytes.length, (long)length);
> 232: }
> 233: );
It has been suggested in past PR reviews (including a few of mine) that we use assertThrows(). vs the expectedException annotation element. Something you might want to consider using here
-------------
Marked as reviewed by lancea (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/5645
More information about the nio-dev
mailing list