RFR: 4619075: (ch) newChannel() should return Gathering/ScatteringByteChannel [v4]
Brian Burkhalter
bpb at openjdk.java.net
Tue Oct 26 21:17:12 UTC 2021
On Wed, 20 Oct 2021 16:40:43 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Modify `Channels.newChannel(InputStream)` and `Channels.newChannel(OutputStream)` to return `ScatteringByteChannel` and `GatheringByteChannel`, respectively.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>
> 4619075: Move read-only check to before read loop
This PR is withdrawn for several reasons:
- As covariant overrides are not supported for static methods, no appealing options remain for new API points.
- The scatter-gather methods in other APIs such as for datagram, file, and socket channels map naturally to native system calls such as `readv(2)` and `writev(2)` which is not the case here so the operations are not atomic.
- The implementation is subject to complex problems if an exception is encountered before all bytes have been read or written.
- There is a lack of clear demand for this functionality.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5922
More information about the nio-dev
mailing list