Skip to content

Commit 1eba374

Browse files
committed
feat: add toByteList method to Content class
1 parent 6d025ce commit 1eba374

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/src/core/content.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class Content {
3030
}
3131
return buffer.buffer;
3232
}
33+
34+
/// Converts the [body] of this [Content] to a [List] of bytes asynchronously.
35+
Future<List<int>> toByteList() async =>
36+
body.expand<int>((element) => element).toList();
3337
}
3438

3539
/// [Content] specific for discovery.

0 commit comments

Comments
 (0)