ZipResourceProvider

The ZipResourceProvider is used for fetching resources from a ZIP archive. It reads ZIP archive data from a RandomAccessDataSource.

The ReadingSystemEngine uses the ZipResourceProvider class internally when you load an EPUB using a RandomAccessDataSource. You can also construct a new instance by calling one of:

When you create a ZipResourceProvider using ReadingSystemEngine.createZipResourceProvider, the implementation will pre-calculate all byte ranges that will be used when fetching data chunks from the ZIP archive. This is a deterministic operation based on the ZipResourceProviderOptions and the ZIP archive. ZipResourceProvider.zipArchiveInformation provides a complete list of the pre-calculated byte ranges.

Parameters

dataSource

A source for data of the resource

zipArchiveInformation

Information about the resource and its structure

cacheSize

Cache size in kilobyte

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun fetch(path: String, options: ResourceRequestOptions): ResourceResponse

Synchronously fetches a resource from this ResourceProvider. The method returns when a response is available.

Link copied to clipboard
open override fun fetchMetadata(path: String, options: ResourceRequestOptions): ResourceMetadata

Same as fetch(), but only returns metadata about the resource.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Get a list about all files in this ZIP archive.