Hi Brett, I think your suggestion makes sense. I have created 
https://bugs.openjdk.org/browse/JDK-8361209 to track this RFE.
Feel free to contribute a patch to implement this enhancement.

________________________________
From: core-libs-dev <core-libs-dev-r...@openjdk.org> on behalf of Brett Okken 
<brett.okken...@gmail.com>
Sent: Tuesday, July 1, 2025 9:57 AM
To: core-libs-dev <core-libs-dev@openjdk.org>
Subject: StringCharBuffer and bulk get

jdk 25 introduced[1] a bulk getChars method to CharSequence[2].
Should StringCharBuffer be updated to utilize that new method to
implement the bulk get method[3]?
That would presumably require changes to the private getArray[4].
I think there could also be changes to putBuffer[5] for when the
target has an array. That array could be used for the getChars call.

[1] - 
https://github.com/openjdk/jdk/commit/7642556a5a131e9104033ad7d7abfdb4be5012cf
[2] - 
https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/lang/CharSequence.html#getChars(int,int,char%5B%5D,int)
[3] - 
https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/nio/CharBuffer.html#get(int,char%5B%5D,int,int)
[4] - 
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/nio/X-Buffer.java.template#L953-L985
[5] - 
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/nio/X-Buffer.java.template#L1152-L1156

Reply via email to