RFR: 8316156: (ch) Channels.newOutputStream(ch).write(bigByteArray) allocates a lot of direct memory [v5]

Paul Wagland duke at openjdk.org
Tue Sep 19 16:34:44 UTC 2023


On Tue, 19 Sep 2023 12:59:37 GMT, Paul Wagland <duke at openjdk.org> wrote:

> If I understand correctly though, after this PR you can just wrap _any_ InputStream into a BIS, and it would be safe, right? Maybe this is something that could be put into `Files.copy`? Then `Files.copy` would always work, and you aren't changing the short read/write characteristics?

Would it make sense to also do this, to ensure that `Files.copy` doesn't fail, regardless of what the input InputStream does?

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

PR Comment: https://git.openjdk.org/jdk/pull/15733#issuecomment-1726044547


More information about the nio-dev mailing list