decode

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.

maxOutputBytes caps the decoded size; exceeding it throws InflateException. A kilobyte of crafted DEFLATE can expand to gigabytes, so callers decoding untrusted streams must pass a cap.