createZipResourceProvider

abstract fun createZipResourceProvider(dataSource: RandomAccessDataSource, zipResourceProviderOptions: ZipResourceProviderOptions = ZipResourceProviderOptions(), onSuccess: (ZipResourceProvider) -> Unit, onError: (ColibrioException) -> Unit)

Creates a new ZipResourceProvider using byte data provided by dataSource. The dataSource must return data from a valid ZIP file, such as an EPUB file for example.

This method uses the Web framework in order to build the required ZipArchiveInformation object. If you already have a serialized ZipArchiveInformation object retrieved from ZipResourceProvider.serializedZipArchiveInformation, then you can create a new ZipResourceProvider without using the Web framework with ZipResourceProvider.create.


abstract suspend fun createZipResourceProvider(dataSource: RandomAccessDataSource, zipResourceProviderOptions: ZipResourceProviderOptions = ZipResourceProviderOptions()): ColibrioResult<ZipResourceProvider>

Creates a new ZipResourceProvider using byte data provided by dataSource. The dataSource must return data from a valid ZIP file, such as an EPUB file for example.

This method uses the Web framework in order to build the required ZipArchiveInformation object. If you already have a serialized ZipArchiveInformation object retrieved from ZipResourceProvider.serializedZipArchiveInformation, then you can create a new ZipResourceProvider without using the Web framework with ZipResourceProvider.create.

Return

Either ColibrioResult.Success with the created ZipResourceProvider when successful, or ColibrioResult.Error containing the error.