StringCharBuffer and bulk get
Chen Liang
chen.l.liang at oracle.com
Tue Jul 1 16:29:23 UTC 2025
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-retn at openjdk.org> on behalf of Brett Okken <brett.okken.os at gmail.com>
Sent: Tuesday, July 1, 2025 9:57 AM
To: core-libs-dev <core-libs-dev at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20250701/c0ae30be/attachment-0001.htm>
More information about the core-libs-dev
mailing list