read method

  1. @override
String read(
  1. BufferContext bc,
  2. int offset
)
override

Read the value at the given offset in bc.

Implementation

@override
@pragma('vm:prefer-inline')
String read(BufferContext bc, int offset) {
  int strOffset = bc.derefObject(offset);
  int length = bc._getUint32(strOffset);
  Uint8List bytes = bc._asUint8LIst(strOffset + 4, length);
  if (_isLatin(bytes)) {
    return new String.fromCharCodes(bytes);
  }
  return utf8.decode(bytes);
}