Codec

interface Codec

A single compression codec: a reversible byte transform. Every codec is buffered, so it takes a whole array and returns a whole array. decompress takes an ArchiveLimits, so the decompression-bomb guard is part of the contract rather than an option a caller can forget.

Inheritors

Properties

Link copied to clipboard
abstract val id: CodecId

Which codec this is.

Functions

Link copied to clipboard
abstract fun compress(data: ByteArray): ByteArray

Compress data fully in memory.

Link copied to clipboard
abstract fun decompress(data: ByteArray, limits: ArchiveLimits = ArchiveLimits.DEFAULT): ByteArray

Decompress data fully in memory, enforcing limits.