Skip to content

Commit

Permalink
refactor(Content): refactor byteBuffer getter
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jun 4, 2023
1 parent 1eba374 commit 0b89228
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/src/core/content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ class Content {

/// Converts the [body] of the content to a [ByteBuffer] asynchronously.
Future<ByteBuffer> get byteBuffer async {
final buffer = Uint8Buffer();
await for (final bytes in body) {
buffer.addAll(bytes);
}
final buffer = Uint8Buffer()..addAll(await toByteList());

return buffer.buffer;
}

Expand Down

0 comments on commit 0b89228

Please sign in to comment.