Skip to content

Commit 0b89228

Browse files
committed
refactor(Content): refactor byteBuffer getter
1 parent 1eba374 commit 0b89228

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/src/core/content.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ class Content {
2424

2525
/// Converts the [body] of the content to a [ByteBuffer] asynchronously.
2626
Future<ByteBuffer> get byteBuffer async {
27-
final buffer = Uint8Buffer();
28-
await for (final bytes in body) {
29-
buffer.addAll(bytes);
30-
}
27+
final buffer = Uint8Buffer()..addAll(await toByteList());
28+
3129
return buffer.buffer;
3230
}
3331

0 commit comments

Comments
 (0)