Integrated: 8333843: Provide guidelines on MemorySegment to read strings with known lengths

Per Minborg pminborg at openjdk.org
Fri Sep 13 14:41:11 UTC 2024


On Tue, 27 Aug 2024 09:36:56 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> This PR proposes to add a new overload to `MemorySegment::getString` whereby it is possible to pass in a known byte length of the content in a segment that should be converted to a String. This is useful in case one already knows the byte length and thereby does not need to scan for a null terminator.

This pull request has now been integrated.

Changeset: 3e0da58e
Author:    Per Minborg <pminborg at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/3e0da58ee6553fc0ed841db4a8800d50bc444517
Stats:     8 lines in 1 file changed: 8 ins; 0 del; 0 mod

8333843: Provide guidelines on MemorySegment to read strings with known lengths

Reviewed-by: mcimadamore

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

PR: https://git.openjdk.org/jdk/pull/20725


More information about the core-libs-dev mailing list