RFR: 8274112: (fc) Tune FileChannel.transferTo() [v6]

Lance Andersen lancea at openjdk.java.net
Fri Apr 29 16:48:44 UTC 2022


On Fri, 29 Apr 2022 15:14:17 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8274112: Revert all changes except mapped transfer threshold
>
> test/jdk/java/nio/channels/FileChannel/TransferToChannel.java line 126:
> 
>> 124:                 for (int i=0; i<size; i++)
>> 125:                     if (incoming[i] != expected[i])
>> 126:                         throw new RuntimeException("Data corrupted");
> 
> Perhaps `if (!Arrays.equals(incoming, 0, size, expected, 0, size))...`

Agree  but I would take it further and create a utility method so that it is reusable as it looks like you could take advantage of it later in the test(around line 175)

-------------

PR: https://git.openjdk.java.net/jdk/pull/5623


More information about the nio-dev mailing list