RFR: 8354724: Methods in java.io.Reader to read all characters and all lines [v19]

Johannes Döbler duke at openjdk.org
Thu May 15 10:55:54 UTC 2025


On Thu, 15 May 2025 10:22:51 GMT, Markus KARG <duke at openjdk.org> wrote:

>> If the source is a `Reader` **and** target is a `Writer`, yes. But what if it is a native piece of hardware, like an IoT device, which produces / consumes `CharSequence`?
>
> Also, in JAX-RS for example, you cannot make use of `transferTo` as what you get is a heap object, and what you must forward also is a heap object.

Thanks for the examples. Imho I think that performance sensitive, specialised code can invest some lines to put together the best solution for the context whereas the majority of code can simply use a convenient `reader.readAllAsString()` instead of `reader.readAllAsCharSequence().toString()` which is borderline to parody.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24728#discussion_r2090896148


More information about the core-libs-dev mailing list