Browse Source

Merge pull request #1166 from nextcloud/perf/dynamite/byte_stream_bytes_collector

pull/1168/head
Nikolas Rimikis 1 year ago committed by GitHub
parent
commit
b0ca19634d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      packages/dynamite/dynamite_runtime/lib/src/http_extensions.dart

7
packages/dynamite/dynamite_runtime/lib/src/http_extensions.dart

@ -18,9 +18,12 @@ final _xmlBytesConverter =
/// Extension on byte streams that enable efficient transformations. /// Extension on byte streams that enable efficient transformations.
extension BytesStreamExtension on BytesStream { extension BytesStreamExtension on BytesStream {
/// Returns the all bytes of the stream. /// Collects all bytes from this stream into one Uint8List.
///
/// The collector will assume that the bytes in this stream will not change.
/// See [BytesBuilder] for further information.
Future<Uint8List> get bytes async { Future<Uint8List> get bytes async {
final buffer = BytesBuilder(); final buffer = BytesBuilder(copy: false);
await forEach(buffer.add); await forEach(buffer.add);

Loading…
Cancel
Save