data property

Stream<Uint8List> get data

Data received on this stream.

Bytes are counted as consumed at the moment they are delivered to the subscriber, which is what drives the receive window. If nobody is listening, or the subscription is paused, events sit in the controller, nothing is counted, the advertised offset stops advancing and the sender stalls — which is the back-pressure. Cached because _dataController is single-subscription, so the mapped view must be a single stable object.

Implementation

Stream<Uint8List> get data => _consumedData ??=
    _dataController.stream.map((chunk) {
      _onDataConsumed(chunk.length);
      return chunk;
    });