StreamReader<T> class

Use for get stream element by read StreamReader can get one element from stream by read method

Design

StreamReader has only one constructor and one parameter, call "RawDataStream". While StreamReader creating, subscribe RawDataStream and control it.

read :

RawDataStream -> Completer -> Read

When read method call, _subscription will call resume, recv new data to Completer as result read return, and then _subscription call pause again.

releaseStream:

If you need data stream instead of read again and again, call releaseStream. Subscription will always resume and never pause again until it done. At this time, read return null forever.

Constructors

StreamReader(Stream<T> rawDataStream)
Constructor

Properties

hashCode int
The hash code for this object.
read-onlyinherited
isEnd bool
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

destroy() → void
Destroy StreamReader
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
read() FutureOr<T>
Whether stream is end (include error occur) Read first data of current data stream If stream is released or end, return null
releaseStream() Stream<T>
Release the stream If stream is released or end, return null If current is waiting for reading, complete null directly
toString() String
A string representation of this object.
inherited

Operators

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