readString method

String readString(
  1. MemoryPointer<RType> p,
  2. int maxLength
)

Implementation

String readString(MemoryPointer p, int maxLength) {
  _check(p, 'readString');
  return switch (type) {
    RInt8() => p.cast<RInt8>().toDartString(maxLength),
    RInt16() => p.cast<RInt16>().toDartString(maxLength),
    RInt32() => p.cast<RInt32>().toDartString(maxLength),
    _ => throw UnsupportedError("Invalid type $R for reading a string value."),
  };
}