Update: MemorySegment has a copyTo(ByteBuffer) method. use that one.