PdfFileCacheNative class

PDF file cache backed by a file.

Because the code internally uses dart:io's File, it is not available on the web.

Inheritance

Constructors

PdfFileCacheNative(File file)

Properties

blockSize int
Size of cache block in bytes.
no setteroverride
cacheControlState → HttpCacheControlState
no setteroverride
cachedBytes int
Number of bytes cached.
no setterinherited
file File
Cache file.
final
filePath String
The file path.
no setteroverride
fileSize int
File size of the PDF file.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isInitialized bool
Determine if the cache is initialized or not.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
totalBlocks int
Number of cache blocks.
no setteroverride

Methods

close() Future<void>
Close the cache file.
override
initializeWithFileSize(int fileSize, {required bool truncateExistingContent}) Future<void>
Initialize the cache file.
override
invalidateCache() Future<void>
override
isCached(int block) bool
Check if the cache block is available.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(List<int> buffer, int bufferPosition, int position, int size) Future<void>
Read size bytes from the cache to buffer (from the position).
override
resetAll() Future<void>
Clear all the cached data.
override
setBlockSize(int cacheBlockSize) bool
Set the cache block size.
override
setCacheControlState(HttpCacheControlState cacheControlState) Future<void>
override
setCached(int startBlock, {int? lastBlock}) Future<void>
Set flag to indicate that the cache block is available.
override
toString() String
A string representation of this object.
inherited
write(int position, List<int> bytes) Future<void>
Write bytes (of the position) to the cache.
override

Operators

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

Static Properties

getCacheDirectory Future<Directory> Function()
Function to determine the cache directory.
getter/setter pair

Constants

dataStrSizeMax → const int
header1Size → const int
headerMagic → const int