RFR: 8369564: Provide a MemorySegment API to read strings with known lengths [v2]
Liam Miller-Cushon
cushon at openjdk.org
Wed Oct 29 16:37:36 UTC 2025
On Wed, 29 Oct 2025 15:29:34 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Liam Miller-Cushon has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Consolidate duplicate code in read methods
>
> src/java.base/share/classes/jdk/internal/foreign/StringSupport.java line 66:
>
>> 64: case SINGLE_BYTE -> readByte(segment, offset, len, charset);
>> 65: case DOUBLE_BYTE -> readShort(segment, offset, len, charset);
>> 66: case QUAD_BYTE -> readInt(segment, offset, len, charset);
>
> These 3 methods appear to be identical
Thanks, I refactored to do something more similar to the original PR to avoid the duplication here and with the existing read methods.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28043#discussion_r2474204354
More information about the core-libs-dev
mailing list