RFR: 8369564: Provide a MemorySegment API to read strings with known lengths [v12]
Maurizio Cimadamore
mcimadamore at openjdk.org
Mon Nov 24 15:17:54 UTC 2025
On Mon, 24 Nov 2025 15:07:47 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> I have tentatively updated the new MemorySegment#copy to return the number of bytes that were written.
Also, if in the future we also enhance encoders to return the length of a string w/o encoding it, it might still be useful to have `copy` return the length (to avoid scanning the string chars twice).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28043#issuecomment-3571278579
More information about the core-libs-dev
mailing list