MemorySource class final
A DataSource backed by an in-memory byte buffer.
The simplest source — wrap a Uint8List you already hold (a download,
an asset, a clipboard paste) and read from it. Random access is a plain
sublist view, so reads are zero-copy and O(1).
final doc = await pdf.open(MemorySource(pdfBytes));
For data that doesn't fit in memory, back the source with a file or an HTTP range reader instead so the input streams in chunks rather than sitting fully in RAM.
- Implemented types
Constructors
- MemorySource(Uint8List _bytes)
-
Wraps
byteswithout copying. The buffer must not be mutated for the lifetime of any operation reading from this source.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readAt(
int offset, int count) → Uint8List -
Read
countbytes starting atoffset.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited