readLargeFileAsBytes function
Get a large file previously sent using writeLargeFile with name
remoteFilePath (relative to appname/data directory) and return
it as bytes.
Implementation
Future<Uint8List> readLargeFileAsBytes({
required String remoteFilePath,
String? ownerWebId,
bool isPodRelativePath = false,
void Function(int, int)? onProgress,
}) async {
final chunks = fetch(
remoteFilePath: remoteFilePath,
ownerWebId: ownerWebId,
isPodRelativePath: isPodRelativePath,
onProgress: onProgress,
);
final builder = BytesBuilder();
await for (final chunk in chunks) {
builder.add(chunk);
}
return builder.toBytes();
}