FileSource class final

A DataSource backed by a file on disk. Native platforms only.

Reads arbitrary offsets via pread-style positioned reads — each call returns only the bytes asked for, so the source holds one chunk at a time, never the whole file. The engine pulls a 7 GB PDF in the same small (≤64KB) bites as a 7 KB one.

import 'package:pdf_manipulator/io.dart';

final doc = await pdf.open(FileSource(File('/path/to/big.pdf')));

Web has no filesystem; this class is exported from package:pdf_manipulator/io.dart (not the main library) so web builds never pull in dart:io. On web, back the source with a Blob instead.

Implemented types

Constructors

FileSource(File _file)
Wraps file. Its length is read synchronously at construction; the file must exist and not be truncated while operations are reading it.

Properties

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

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readAt(int offset, int count) Future<Uint8List>
Read count bytes starting at offset.
override
toString() String
A string representation of this object.
inherited

Operators

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