RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v13]

Markus KARG duke at openjdk.org
Wed Dec 13 16:23:44 UTC 2023


On Wed, 13 Dec 2023 15:53:09 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> It doesn't make sense here to add a new package com.sun.io for a single method class. This PR does not need to introduce any new classes at this point. I think this PR needs to focus solely on BIS.

So you actually prefer copy-and-paste and duplicated code?

> On the surface, transferTo reads to EOF so there are no more bytes to read from the underlying stream or byte[]. Adding a "growing file" and it breaks assumptions. So it's an important discussion point in this topic.

I still do not see what this has to do with the *actual* changes proposed by this PR. Can you please provide an example in what situation the *actual* changes proposed by this PR will fail in that case, while the original code will succeed?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16879#discussion_r1425592402


More information about the core-libs-dev mailing list