RFR: 8306308: (ch) Writer created by Channels::newWriter may lose data

Brian Burkhalter bpb at openjdk.org
Tue Oct 17 15:16:46 UTC 2023


On Mon, 16 Oct 2023 21:20:17 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Change `Channels.newWriter` to return a `Writer` created by first wrapping the `WritableByteChannel` in an `OutputStream` using `Channels.newOutputStream` and then wrapping the result in an `OutputStreamWriter`. With this change in place, the problems reported in the issue do not occur.

This was just a first stab to elicit comments and verify the approach. Note that this would make `minBufferCap` irrelevant. I wonder whether some sort of `@xyzNote` would be appropriate to make that obvious.

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

PR Comment: https://git.openjdk.org/jdk/pull/16207#issuecomment-1766627675


More information about the nio-dev mailing list