RFR: 8265891: (ch) InputStream returned by Channels.newInputStream should override transferTo [v6]
Alan Bateman
alanb at openjdk.java.net
Fri Jul 30 12:12:30 UTC 2021
On Thu, 29 Jul 2021 19:57:30 GMT, Markus KARG <github.com+1701815+mkarg at openjdk.org> wrote:
>> Good point.
>
> :-)
Is this loop correct for the case that the channel gets truncated? In that case transferTo will return 0 as no bytes will be transferred and I'm concerned this code will go into an infinite loop.
Also can you can check that IllegalBlockingModeException is thrown for the case ch is a SelectableChannel configured non-blocking and the destination is a FileChannel?
Just on naming, the existing channel implementations use "dst" for the destination and "wbc" (not "oc") for writable byte channels. Just mentioning it so that the new code can be kept consistent where possible.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4263
More information about the core-libs-dev
mailing list