BlobByteSource class
A RandomAccessByteSource that reads a browser Blob — usually a File
from an <input type="file"> or a drop event — one slice at a time, so
a slide opened from it with SvsFile.openSource is never loaded into
memory whole, however large it is.
import 'package:svs/svs.dart';
import 'package:svs/svs_web.dart';
import 'package:web/web.dart' as web;
Future<SvsFile> openPicked(web.File file) =>
SvsFile.openSource(BlobByteSource(file));
- Implemented types
Constructors
- BlobByteSource(JSObject blob)
-
Wraps
blob, which must be a JSBlob(aFileis one) — throws ArgumentError otherwise. Takes a plain JSObject so any binding works, e.g.package:web'sFile/Blob.
Properties
Methods
-
close(
) → Future< void> -
A no-op: a
Blobholds no handle to release.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readRange(
int offset, int length) → Future< Uint8List> -
Reads up to
lengthbytes starting atoffset. Best-effort at the end of the source: returns fewer bytes (down to empty) rather than padding or throwing. The reader checks the length it gets back itself, and reports a truncated file as an SvsFormatException.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited