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

PseudoFile.readOnly constructor

PseudoFile.readOnly(ReadFn _readFn)

Creates a new read-only PseudoFile backed by the specified read handler.

The 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.

Implementation

PseudoFile.readOnly(this._readFn)
    : _capacity = 0,
      assert(_readFn != null);