toDartString method

String toDartString([
  1. int? maxLength
])

Reads a NUL-terminated C string starting at this pointer, decoded as UTF-8. Scans for the NUL byte itself, no length needed.

If maxLength is provided reads at most maxLength bytes as a UTF-8 string, stopping early at a NUL byte if found first. Use when you know a bound (e.g. a fixed-size char buffer) but the string may be shorter.

Implementation

String toDartString([int? maxLength]) => _decodeUtf8(0, maxLength);