HttpRangeByteSource class
Reads a TIFF/BigTIFF file over HTTP with Range requests, fetching only the header, the IFDs, and the strips/tiles each decode needs — e.g. a cloud-optimized GeoTIFF or a whole-slide image on a server or bucket.
The server must answer Range requests with 206 Partial Content and a
Content-Range header. Cross-origin, it must also allow the Range
request header and expose Content-Range
(Access-Control-Expose-Headers: Content-Range).
final source = await HttpRangeByteSource.open(Uri.parse(url));
final document = await TiffDecoder.decodeAsync(source);
- Inheritance
-
- Object
- TiffAsyncByteSource
- HttpRangeByteSource
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> -
Extra request headers sent with every read, e.g.
Authorization.final - length → int
-
Total size of the file in bytes.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url → Uri
-
The file being read.
final
Methods
-
close(
) → void -
Releases any underlying resources. Called by TiffDocument.close.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
int offset, int length) → Future< Uint8List> -
Reads exactly
lengthbytes starting atoffset. Never called with a range outside0..this.length, and may be called several times concurrently.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
open(
Uri url, {Map< String, String> headers = const {}}) → Future<HttpRangeByteSource> -
Opens
url, learning its size from theContent-Rangeof a one-byte request. Throws a TiffException if the server doesn't support Range requests or doesn't exposeContent-Range.