downloadData method

Future<Uint8List?> downloadData([
  1. int maxSize = 10485760
])

Downloads specified data from the cloud to a Uint8List object.

  • maxSize: Maximum size of the data to be downloaded.

Implementation

Future<Uint8List?> downloadData([int maxSize = 10485760]) async {
  try {
    return await _methodChannel.invokeMethod<Uint8List?>(
      'AGCStorageReference#downloadData',
      <String, dynamic>{
        'bucket': storage.bucket,
        'policyIndex': storage.policy?.index,
        'objectPath': path,
        'maxSize': maxSize,
      },
    );
  } catch (e) {
    throw AGCStorageException._from(e);
  }
}