readStringOrNull method

String? readStringOrNull(
  1. int offset, {
  2. bool staticOffset = true,
})

Implementation

@pragma('vm:prefer-inline')
String? readStringOrNull(int offset, {bool staticOffset = true}) {
  if (staticOffset && offset >= _staticSize) return null;
  final bytesOffset = _byteData.getUint32(offset, Endian.little);
  if (bytesOffset == 0) {
    return null;
  }
  final length = _byteData.getUint32(offset + 4, Endian.little);

  return utf8Decoder.convert(_buffer, bytesOffset, bytesOffset + length);
}