[External] : Re: MemorySegment APIs for reading and writing strings with known lengths
Liam Miller-Cushon
cushon at google.com
Wed Nov 12 11:40:49 UTC 2025
>
> For the non-\0 terminated strings, you have the String-based
> MemorySegment::copy I described - e.g.
>
> void copy(String srcString, Charset srcCharset, int srcIndex, MemorySegment dstSegment, long dstOffset, int length);
>
> With this, we also have two cases:
>
> * if the charset is compatible with the string buffer, we just bulk-copy
> the string buffer (or a portion of it) into the dest segment
> * otherwise we can encode the srcString directly into the dest segment
>
Thanks! I think I'm caught up now. My misunderstanding was whether
MS::ofString was being suggested instead of and not in addition to the bulk
copy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20251112/7c3675b4/attachment.htm>
More information about the panama-dev
mailing list