TerminatedTransformer constructor

TerminatedTransformer({
  1. bool sync = false,
  2. bool? cancelOnError,
  3. Uint8List? terminator,
  4. int maxLen = 1024,
  5. dynamic stripTerminator = true,
})

Splits the incoming stream at the given terminator sequence. maxLen is the maximum number of bytes that will be collected before a terminator is detected. If more data arrives the oldest bytes will be discarded. terminator is a Uint8List of bytes. stripTerminator is a boolean indicating if the terminator should remain attached in the output.

This constructor creates a single stream

Implementation

TerminatedTransformer({bool sync = false, this.cancelOnError, this.terminator, this.maxLen = 1024, this.stripTerminator = true}) {
  _partial = [];
  _controller = new StreamController<Uint8List>(
      onListen: _onListen,
      onCancel: _onCancel,
      onPause: () {
        _subscription!.pause();
      },
      onResume: () {
        _subscription!.resume();
      },
      sync: sync);
}