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

Brian Burkhalter bpb at openjdk.org
Mon Oct 16 21:25:53 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.

I am not entirely certain that this change is exactly what @djelinski intended in his [comment](https://bugs.openjdk.org/browse/JDK-8306308?focusedCommentId=14575246&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14575246) on the issue.

No tests are included pending comments on whether this is the right approach.

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

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


More information about the nio-dev mailing list