addStream method

  1. @override
Future<void> addStream(
  1. Stream<List<int>> stream, {
  2. bool close = true,
})
override

The addStream method is used to send a stream of data to the response.

Implementation

@override
Future<void> addStream(Stream<List<int>> stream, {bool close = true}) async {
  // Allow streaming without buffering the entire response in memory.
  original.bufferOutput = false;
  await original.addStream(stream);
  if (close) {
    await original.close();
    _isClosed = true;
  }
}