platform/bounded_file_snapshot library
Functions
-
readBoundedByteStreamSnapshot(
Stream< List< source, {required String resourcePath, required int maxBytes}) → Future<int> >Uint8List> -
Accumulates a bounded byte snapshot from
source. -
readBoundedFileSnapshot(
File file, {required int maxBytes}) → Future< Uint8List> -
Reads at most
maxBytesfrom one stream-backed file snapshot. -
readBoundedFileStringSnapshot(
File file, {required int maxBytes, Encoding encoding = utf8}) → Future< String>
Exceptions / Errors
- BoundedFileSnapshotOverflowException
- Raised when a file snapshot contains more bytes than its caller permits.