Package-level declarations

Types

Link copied to clipboard
data class ArchiveEntry(val name: String, val size: Long, val isDirectory: Boolean, val lastModifiedEpochSeconds: Long? = null, val compressedSize: Long = size, val codec: CodecId = CodecId.STORE, val isEncrypted: Boolean = false, val crc32: Long? = null, val dataOffset: Long = -1L)

One member of a container. name is the raw stored name. Always run it through io.github.yuroyami.kitearchive.security.PathGuard before joining it to an output directory. dataOffset is where the entry's bytes begin in the source (container internal); -1 when not applicable.

Link copied to clipboard

A container / single-stream format detected by Magic.

Link copied to clipboard
interface ArchiveReader

Read side of a container. entries lists members from the header alone and touches no payload, which is "browse without extract". read materialises one entry's uncompressed bytes under the bomb ArchiveLimits.

Link copied to clipboard
Link copied to clipboard
object Magic

Magic-byte format sniffer. It reads a header, or the first 512 bytes of a RandomAccessSource, and returns the matching ArchiveFormat. Brotli has no magic bytes, so this object never detects it.

Link copied to clipboard

A seekable, random-access byte source. Every container reader works against this read contract. ZIP "browse without extract" (read the central directory at the tail) and single-entry extract (seek to one local header) both need offset reads rather than a forward-only stream.

Functions

Link copied to clipboard

Read exactly length bytes at offset, or fail. Convenience over RandomAccessSource.read.