add method

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

Adds a data event to the sink.

Must not be called on a closed sink.

Implementation

@override
void add(List<int> data) {
  if (_done.isCompleted) {
    throw StateError('Cannot add to closed MockHttpRequest.');
  } else {
    _headers.lock();
    _contentLength += data.length;
    _buf.add(data);
  }
}