Inflate

object Inflate

Functions

Link copied to clipboard
fun decode(input: ByteArray, offset: Int = 0, length: Int = input.size - offset, maxOutputBytes: Int = Int.MAX_VALUE): ByteArray

One-shot: inflate the DEFLATE payload in input starting at offset for length bytes (defaults to the whole array). The offset/length window lets callers (e.g. the zlib wrapper) skip header/trailer bytes without slicing.

Link copied to clipboard
fun decodePlatform(input: ByteArray, offset: Int = 0, length: Int = input.size - offset, maxOutputBytes: Int = Int.MAX_VALUE): ByteArray

decode behind the platform fast path (T-10): native inflate where the target has one, this pure-Kotlin decoder otherwise (and for any stream the fast path rejects, preserving lenient errors). Same contract as decode; use it on hot paths (zip entries), keep decode where the pure implementation itself is under test.