PackSource

interface PackSource(source)

One store's delivery: Play, Apple's, or local files. Paths are inside the pack, without the <packId>/ prefix; each source adds it. Apps use AssetPacks, which adds shared fetches and the integrity check on top of a source.

Inheritors

BundledAssetPacks
PlayAssetPacks
AppleStoreSource

Functions

Link copied to clipboard
abstract suspend fun fetch(packId: String): PackState

Starts or resumes the download and suspends until the state isSettled. Cancelling cancels the download.

Link copied to clipboard
abstract suspend fun readBytes(packId: String, path: String): ByteArray?

A file of a ready pack, or null when the pack is not ready or has no such file.

Link copied to clipboard
abstract suspend fun remove(packId: String)

Frees the pack's space; the next fetch downloads it again.

Link copied to clipboard
abstract fun state(packId: String): Flow<PackState>

The pack's state; the first value is read from the store, never assumed.