create

fun create(dataSource: RandomAccessDataSource, serializedZipArchiveInformation: ByteArray, onSuccess: (ZipResourceProvider) -> Unit, onError: (ColibrioException) -> Unit)

Create a new instance of ZipResourceProvider using a RandomAccessDataSource to read the ZIP archive and serialized ZipArchiveInformation in binary format describing the ZIP archive.

You can get a serialized ZipArchiveInformation in binary format from ZipResourceProvider.serializedZipArchiveInformation. If you don't have access to serialized ZipArchiveInformation, you can create a new ZipResourceProvider with ReadingSystemEngine.createZipResourceProvider instead.

This method will fail and invoke onError if you call it with invalid data or with ZipArchiveInformation data that does not match the ZIP archive.

Parameters

dataSource

A RandomAccessDataSource used for reading the ZIP archive.

serializedZipArchiveInformation

Serialized information about this ZIP archive.

onSuccess

Called with the new ZipResourceProvider if the operation is successful.

onError

Called if the operation fails.


suspend fun create(dataSource: RandomAccessDataSource, serializedZipArchiveInformation: ByteArray): ColibrioResult<ZipResourceProvider>

Create a new instance of ZipResourceProvider using a RandomAccessDataSource to read the ZIP archive and serialized ZipArchiveInformation in binary format describing the ZIP archive.

You can get a serialized ZipArchiveInformation in binary format from ZipResourceProvider.serializedZipArchiveInformation. If you don't have access to serialized ZipArchiveInformation, you can create a new ZipResourceProvider with ReadingSystemEngine.createZipResourceProvider instead.

This method will fail and return a ColibrioResult.Error if you call it with invalid data or with ZipArchiveInformation data that does not match the ZIP archive.

Return

Either ColibrioResult.Success containing ZipResourceProvider instance or ColibrioResult.Error containing the error.

Parameters

dataSource

A RandomAccessDataSource used for reading the ZIP archive.

serializedZipArchiveInformation

Serialized information about this ZIP archive.