Utf8StringPointer extension

on

Methods

toDartString([int? maxLength]) → String

Available on MemoryPointer<RInt8>, provided by the Utf8StringPointer extension

Reads a NUL-terminated C string starting at this pointer, decoded as UTF-8. Scans for the NUL byte itself, no length needed.
writeString(String text, [int? maxLength, int byteOffset = 0]) → void

Available on MemoryPointer<RInt8>, provided by the Utf8StringPointer extension

Writes text into a buffer field at address + byteOffset. If maxLength is null, it's derived from the UTF-8 byte length of text (caller is responsible for the field actually being that size). Truncates if text exceeds maxLength; otherwise NUL-terminates and zero-pads the remainder.