RandomAccessByteSource class abstract
A random-access source of a slide's bytes: reads an arbitrary [offset, offset + length) range without needing the whole file in hand up front.
Pass one to SvsFile.openSource to open a slide from wherever its bytes
live — only the ranges actually needed (the TIFF directories, then each
tile as it's viewed) are ever read, so even a multi-GB slide never has to
fit in memory. package:svs/svs_web.dart's BlobByteSource reads a
browser File/Blob this way; implement this class yourself for any
other storage (e.g. HTTP Range requests against a server).
Implementations must cope with several readRange calls in flight at once (tiles are requested concurrently while panning), serializing them internally if the underlying storage needs that.
- Implementers
Constructors
- RandomAccessByteSource()
-
Allows subclasses to declare a const constructor of their own.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → Future< void> - Releases any underlying resource, e.g. a file handle. Called once by SvsFile.close, or by SvsFile.openSource if the slide fails to open.
-
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. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited