SpzInflater

fun interface SpzInflater

Platform-pluggable gzip / deflate inflater. SPZ payloads are gzip-compressed after the fixed 16-byte header — the engine has no built-in inflater that works across all KMP targets (JVM has GZIPInputStream, K/N doesn't, Kotlin/JS would need a separate Pako binding), so we expose this hook and let the app wire the most appropriate implementation per target.

Wire one impl at startup, before the first SPZ tile is fetched:

SpzGaussianLoader.inflater = MyJvmInflater()

Default is null. With no inflater registered, SpzGaussianLoader.parse throws an IllegalStateException; SpzGaussianLoader.supports still detects the magic bytes so the layer can route the tile to a different loader if one's available.

Inheritors

JvmSpzInflater

Functions

Link copied to clipboard
abstract fun inflate(bytes: ByteArray): ByteArray

Inflate a gzip stream. Implementations decompress bytes and return the inflated payload. May throw on malformed inputs — the loader treats throws as parse failures and the tile transitions to FAILED state.