readString method

String readString(
  1. int offset, [
  2. int? byteCnt,
  3. bool allowMalformed = true
])

Reads a part of the buffer starting at offset as an UTF-8 encoded string.

If byteCnt is omitted, it is assumed the UTF-8 encoded string in the buffer is zero terminated. allowMalformed is passed to utf8.decode to allow or disallow invalid UTF-8 sequences in the buffer.

Implementation

String readString(int offset, [int? byteCnt, bool allowMalformed = true]) {
  return readFromBufferAsString(this, offset, byteCnt, allowMalformed);
}