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

Brian Burkhalter bpb at openjdk.org
Tue Sep 19 17:02:42 UTC 2023


On Tue, 19 Sep 2023 16:31:48 GMT, Paul Wagland <duke at openjdk.org> wrote:

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

It would make sense to clamp the uses of `transferTo` in `Files.copy` to a maximum chunk size, but I don't think wrapping in a `ByteArrayInputstream` is the way to go.

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

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


More information about the nio-dev mailing list