RFR: 8354724: Methods in java.io.Reader to read all characters and all lines [v19]
Markus KARG
duke at openjdk.org
Wed May 14 17:59:57 UTC 2025
On Wed, 14 May 2025 17:56:04 GMT, Markus KARG <duke at openjdk.org> wrote:
>> I think this is just a convenience API. A CharSequence-returning API would suit better if it supports arbitrarily long lengths (assuming such a length is in the range of int), while String has implementation limits on lengths and is allowed to fail for this API with OOME. If we make this a CharSequence-returning API that fails with OOME for String implementation limits, I don't think this will please anybody.
>
> As being a server developer for decades I need to say that I would love to have this not for convenience but for the performance reasons explained above, and that `int` length is perfect to speed up 99,9% of all cases. So we should not forget about `CharSequence` hastily.
BTW, it will not fail with OOME, but it should throw IOE in that case.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24728#discussion_r2089464567
More information about the core-libs-dev
mailing list