StreamReaderState class Null safety

As the Persistence class is itself stateless, it uses the StreamReaderState class to maintain and feed it with information from a stream.

The StreamReaderState abstracts away the chunked reading and presents to the outside world a continuous linear interface to the stream.

Constructors

StreamReaderState(Stream<List<int>> _stream, [int? _streamSizeBytesHint])

Properties

bytesRead int
Keeps track of how many bytes have been read so far.
read-only
hashCode int
The hash code for this object.
read-onlyinherited
remainingStreamBytesHint int?
Returns the number of bytes of the stream that have not been read yet, if known. This is a hint only, and may thus be incorrect - it can only be used to pre-allocate memory in readers in order to hopefully reduce repeated re-allocations, not to determine if the stream is finished. If more bytes have already been read than the hint promised, the result is by definition invalid and null will be returned.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
readByteData(int maxBytes, int bytesMultiple) Future<ByteData>
Reads ByteData of at most maxBytes length (since the stream may not contain that many bytes), but such at the amount read is always a multiple of bytesMultiple.
readBytes(int nrBytesToRead) Future<List<int>?>
Reads a list of bytes of nrBytesToRead bytes from the stream, if possible, or null otherwise (e.g. the stream doesn't contain nrBytesToRead bytes).
readString(int length) Future<String?>
Like readBytes, but returns an ASCII string.
readUint16() Future<int?>
Like readBytes, but reads a Uint16 and returns it as int.
readUint8() Future<int?>
Like readBytes, but reads a single Uint8 and returns it as int.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited