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

PseudoFile.readWrite constructor

PseudoFile.readWrite(int _capacity, ReadFn _readFn, WriteFn _writeFn)

Creates new PseudoFile backed by the specified read and write handlers.

The read handler is called every time a read operation is performed on the file. It is only allowed to read at offset 0, and all of the content returned by the handler is returned by the read operation. Subsequent reads act the same - there is no seek position, nor ability to read content in chunks.

The write handler is called every time a write operation is performed on the file. It is only allowed to write at offset 0, and all of the new content should be provided to a single write operation. Subsequent writes act the same - there is no seek position, nor ability to write content in chunks.

Implementation

PseudoFile.readWrite(this._capacity, this._readFn, this._writeFn)
    : assert(_writeFn != null),
      assert(_readFn != null),
      assert(_capacity > 0);