Index: pkg/http/lib/src/byte_stream.dart |
diff --git a/pkg/http/lib/src/byte_stream.dart b/pkg/http/lib/src/byte_stream.dart |
index b53b8eb601fbbfbe563d4af3523ec9ba8cb50ae0..f2c6a0bcaa036547b1bc51dbb5abc7ea29d2b5b4 100644 |
--- a/pkg/http/lib/src/byte_stream.dart |
+++ b/pkg/http/lib/src/byte_stream.dart |
@@ -23,7 +23,7 @@ class ByteStream extends StreamView<List<int>> { |
/// Collects the data of this stream in a [Uint8List]. |
Future<Uint8List> toBytes() { |
/// TODO(nweiz): use BufferList when issue 6409 is fixed. |
- return reduce(<int>[], (buffer, chunk) { |
+ return fold(<int>[], (buffer, chunk) { |
buffer.addAll(chunk); |
return buffer; |
}).then(toUint8List); |