readNullTerminated method

Uint8List readNullTerminated ()

Implementation

Uint8List readNullTerminated() {
  var buf = Buffer();
  while (true) {
    int byte = readUint8();
    if (byte == 0) break;
    buf.addUint8(byte);
  }
  return buf.bytes;
}