saveBytes method

Future<void> saveBytes(
  1. List<int> bytes,
  2. String filename, {
  3. String? mimeType,
})

Convenience method to save raw bytes with a specified filename.

Implementation

Future<void> saveBytes(
  List<int> bytes,
  String filename, {
  String? mimeType,
}) async {
  _log.info('Saving raw bytes to file: "$filename"');
  await _downloader.downloadFile(
    bytes is Uint8List ? bytes : Uint8List.fromList(bytes),
    filename,
    mimeType: mimeType,
  );
}