RFR: 8361018: Re-examine buffering and encoding conversion in BufferedWriter [v6]

Xueming Shen sherman at openjdk.org
Tue Jul 1 19:20:40 UTC 2025


On Tue, 1 Jul 2025 14:33:34 GMT, Brett Okken <duke at openjdk.org> wrote:

>  StreamEncoder/CharsetEncoder that is really forcing that - and the conversion to utf-16 is required for optimal encoder performance.

It might be worth exploring the idea of using string-buffer as the buffer to carry the byte[] + coder (delaying the byte[] → char[] conversion) to the StreamEncoder, and then wrapping it as a StringCharBuffer all the way down to the charset/encoder layer. This could enable potential optimizations at individual charset encoder level.

It's unclear how significant the cost would be for the additional asb + scb wrapping and the access.

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

PR Comment: https://git.openjdk.org/jdk/pull/26022#issuecomment-3025232418


More information about the nio-dev mailing list