Google is committed to advancing racial equity for Black communities. See how.

PseudoFile.readWriteStr constructor

PseudoFile.readWriteStr(int _capacity, ReadFnStr rfn, WriteFnStr wfn)

See #readWrite(). Wraps the read callback, allowing it to return a String instead of a Uint8List. Wraps the write callback, only allowing valid UTF-8 content to be written into the file. Written bytes are converted into a string instance, and the passed to the handler. In every other aspect behaves just like #readWrite().

Implementation

PseudoFile.readWriteStr(this._capacity, ReadFnStr rfn, WriteFnStr wfn)
    : assert(_capacity > 0),
      assert(rfn != null),
      assert(wfn != null) {
  _readFn = _getReadFn(rfn);
  _writeFn = _getWriteFn(wfn);
}