add method

  1. @override
void add(
  1. List<int> chunk
)
override

Adds data to the sink.

Must not be called after a call to close.

Implementation

@override
void add(List<int> chunk) {
  if (_closed) {
    throw StateError('BrotliDecoderSink is closed');
  }
  if (_done) {
    return; // streaming semantics: extra input after done is ignored
  }
  // The queue takes bytes by reference; copy because a converter input chunk
  // may be reused by the caller after `add` returns.
  _decoder.addInput(Uint8List.fromList(chunk));
  _pump();
}