Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Avoid copying with BytesBuilder #186

Merged
merged 2 commits into from
Jul 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/byte_collector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ CancelableOperation<Uint8List> collectBytesCancelable(
/// so it can cancel the operation.
T _collectBytes<T>(Stream<List<int>> source,
T Function(StreamSubscription<List<int>>, Future<Uint8List>) result) {
var bytes = BytesBuilder();
var bytes = BytesBuilder(copy: false);
var completer = Completer<Uint8List>.sync();
var subscription =
source.listen(bytes.add, onError: completer.completeError, onDone: () {
Expand Down