BlobSource class final

A DataSource backed by a browser Blob. Web only.

A File from a file picker or a drop is a Blob. The Blob goes to the lane's worker with the job, by reference and without a copy, and the worker reads the slices the engine asks for synchronously (in OPFS mode it first copies the Blob to its own OPFS file): memory stays O(1) for a file of any size, and no read crosses to the main thread.

import 'package:pdf_manipulator/web.dart';

final doc = await pdf.open(PdfInput(BlobSource(file)));

A file that changes on disk while an operation reads it fails that operation with PdfIoFailed; it never reads wrong bytes.

Implemented types

Constructors

BlobSource(Blob blob)
Wraps blob without reading it.

Properties

blob → Blob
The wrapped Blob.
final
hashCode → int
The hash code for this object.
no setterinherited
length → int
Total size in bytes.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Holds nothing to release.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readAt(int offset, int count) → Future<Uint8List>
Reads on the main thread through Blob.slice().arrayBuffer(). A lane does not call it for this source; it is for reading the source yourself.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited