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
-
- Object
- PdfFileCache
- PdfFileCacheNative
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 tobuffer
(from theposition
).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 theposition
) 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
Static Methods
-
fromFile(
File file) → Future< PdfFileCacheNative> -
fromUri(
Uri uri) → Future< PdfFileCacheNative> -
getCacheFilePathForUri(
Uri uri) → Future< File>
Constants
- dataStrSizeMax → const int
- header1Size → const int
- headerMagic → const int