StringCharBuffer and bulk get
Chen Liang
chen.l.liang at oracle.com
Wed Jul 2 15:48:13 UTC 2025
I think Brett is right. The spec of CharBuffer says:
The methods defined by {@code CharSequence} operate relative to the current
position of the buffer when they are invoked.
Yet getChars is an absolute bulk get method.
Since JDK25 is still in RDP, we still have a chance to fix this up.
________________________________
From: core-libs-dev <core-libs-dev-retn at openjdk.org> on behalf of Brian Burkhalter <brian.burkhalter at oracle.com>
Sent: Wednesday, July 2, 2025 10:40 AM
To: Brett Okken <brett.okken.os at gmail.com>
Cc: core-libs-dev <core-libs-dev at openjdk.org>
Subject: Re: StringCharBuffer and bulk get
Some methods are absolute and some relative:
https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/nio/Buffer.html#transferring-data-heading
On Jul 2, 2025, at 8:35 AM, Brett Okken <brett.okken.os at gmail.com> wrote:
CharBuffer implementation of public default void getChars(int
srcBegin, int srcEnd, char[] dst, int dstBegin) uses absolute
positioning for the indexes (i.e. ignores the current position).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20250702/e1ca583e/attachment-0001.htm>
More information about the core-libs-dev
mailing list