RFR: 8278268 - (ch) InputStream returned by Channels.newInputStream should have fast path for FileChannel targets [v16]

Markus KARG duke at openjdk.java.net
Wed Dec 29 09:01:12 UTC 2021


On Sat, 25 Dec 2021 16:10:37 GMT, Markus KARG <duke at openjdk.java.net> wrote:

>> This sub-issue defines the work to be done to implement JDK-8265891 solely for the particular case of FileChannel.transferFrom(ReadableByteChannel), including special treatment of SelectableByteChannel.
>
> Markus KARG has updated the pull request incrementally with three additional commits since the last revision:
> 
>  - separate test class for each large file test
>  - Base class only contains utilities and helpers
>  - Renamed AbstractTransferTo to TransferToBase as it is not abstract

> Good sleuthing! This is a design bug that goes back to JSR-51/Java 1.4 (https://bugs.openjdk.java.net/browse/JDK-4509080) ... The main question is whether it's worth doing.

Thank you for your ideas. On a gut level I would say I will try it out and when the result smells fine I will open a PR for further discussion. What intrigues me most is that solving this problem also would effectively result in potentially higher throughput of the overall system, as read and write are not mutual exclusive anymore. So from a first glimpse I would say it is worth doing it, but I need to give it more in-depth analysis.

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

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


More information about the nio-dev mailing list