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

Alan Bateman alanb at openjdk.org
Tue Oct 17 06:00:19 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.

It's a simple approach but I think you'll create to some some benchmarks to demonstrate that the channel handling in StreamEncoder can be removed.

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

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


More information about the nio-dev mailing list