Package-level declarations

Core entry points, reader interfaces, seekable data sources, and exception hierarchy for reading archives across JVM, Android, iOS, JS, and WasmJs.

Quick Start

Use com.sorrowblue.kioarch.KioArch.createReader to open an archive from a file path, in-memory ByteArray, platform-specific descriptor (java.io.File, Android Uri / ParcelFileDescriptor, Apple NSData / NSURL / NSFileHandle), or a custom com.sorrowblue.kioarch.SeekableSource:

import com.sorrowblue.kioarch.KioArch
import com.sorrowblue.kioarch.extractToByteArray
import kotlinx.io.files.Path

KioArch.createReader(Path("archive.7z")).use { reader ->
for (entry in reader.getEntries()) {
if (!entry.isDirectory) {
val bytes = entry.extractToByteArray(reader)
println("${entry.name}: ${bytes.size} bytes")
}
}
}

Core entry points, reader interfaces, seekable data sources, and exception hierarchy for reading archives across JVM, Android, iOS, JS, and WasmJs.

Quick Start

Use com.sorrowblue.kioarch.KioArch.createReader to open an archive from a file path, in-memory ByteArray, platform-specific descriptor (java.io.File, Android Uri / ParcelFileDescriptor, Apple NSData / NSURL / NSFileHandle), or a custom com.sorrowblue.kioarch.SeekableSource:

import com.sorrowblue.kioarch.KioArch
import com.sorrowblue.kioarch.extractToByteArray
import kotlinx.io.files.Path

KioArch.createReader(Path("archive.7z")).use { reader ->
for (entry in reader.getEntries()) {
if (!entry.isDirectory) {
val bytes = entry.extractToByteArray(reader)
println("${entry.name}: ${bytes.size} bytes")
}
}
}

Core entry points, reader interfaces, seekable data sources, and exception hierarchy for reading archives across JVM, Android, iOS, JS, and WasmJs.

Quick Start

Use com.sorrowblue.kioarch.KioArch.createReader to open an archive from a file path, in-memory ByteArray, platform-specific descriptor (java.io.File, Android Uri / ParcelFileDescriptor, Apple NSData / NSURL / NSFileHandle), or a custom com.sorrowblue.kioarch.SeekableSource:

import com.sorrowblue.kioarch.KioArch
import com.sorrowblue.kioarch.extractToByteArray
import kotlinx.io.files.Path

KioArch.createReader(Path("archive.7z")).use { reader ->
for (entry in reader.getEntries()) {
if (!entry.isDirectory) {
val bytes = entry.extractToByteArray(reader)
println("${entry.name}: ${bytes.size} bytes")
}
}
}

Core entry points, reader interfaces, seekable data sources, and exception hierarchy for reading archives across JVM, Android, iOS, JS, and WasmJs.

Quick Start

Use com.sorrowblue.kioarch.KioArch.createReader to open an archive from a file path, in-memory ByteArray, platform-specific descriptor (java.io.File, Android Uri / ParcelFileDescriptor, Apple NSData / NSURL / NSFileHandle), or a custom com.sorrowblue.kioarch.SeekableSource:

import com.sorrowblue.kioarch.KioArch
import com.sorrowblue.kioarch.extractToByteArray
import kotlinx.io.files.Path

KioArch.createReader(Path("archive.7z")).use { reader ->
for (entry in reader.getEntries()) {
if (!entry.isDirectory) {
val bytes = entry.extractToByteArray(reader)
println("${entry.name}: ${bytes.size} bytes")
}
}
}

Core entry points, reader interfaces, seekable data sources, and exception hierarchy for reading archives across JVM, Android, iOS, JS, and WasmJs.

Quick Start

Use com.sorrowblue.kioarch.KioArch.createReader to open an archive from a file path, in-memory ByteArray, platform-specific descriptor (java.io.File, Android Uri / ParcelFileDescriptor, Apple NSData / NSURL / NSFileHandle), or a custom com.sorrowblue.kioarch.SeekableSource:

import com.sorrowblue.kioarch.KioArch
import com.sorrowblue.kioarch.extractToByteArray
import kotlinx.io.files.Path

KioArch.createReader(Path("archive.7z")).use { reader ->
for (entry in reader.getEntries()) {
if (!entry.isDirectory) {
val bytes = entry.extractToByteArray(reader)
println("${entry.name}: ${bytes.size} bytes")
}
}
}

Core entry points, reader interfaces, seekable data sources, and exception hierarchy for reading archives across JVM, Android, iOS, JS, and WasmJs.

Quick Start

Use com.sorrowblue.kioarch.KioArch.createReader to open an archive from a file path, in-memory ByteArray, platform-specific descriptor (java.io.File, Android Uri / ParcelFileDescriptor, Apple NSData / NSURL / NSFileHandle), or a custom com.sorrowblue.kioarch.SeekableSource:

import com.sorrowblue.kioarch.KioArch
import com.sorrowblue.kioarch.extractToByteArray
import kotlinx.io.files.Path

KioArch.createReader(Path("archive.7z")).use { reader ->
for (entry in reader.getEntries()) {
if (!entry.isDirectory) {
val bytes = entry.extractToByteArray(reader)
println("${entry.name}: ${bytes.size} bytes")
}
}
}

Core entry points, reader interfaces, seekable data sources, and exception hierarchy for reading archives across JVM, Android, iOS, JS, and WasmJs.

Quick Start

Use com.sorrowblue.kioarch.KioArch.createReader to open an archive from a file path, in-memory ByteArray, platform-specific descriptor (java.io.File, Android Uri / ParcelFileDescriptor, Apple NSData / NSURL / NSFileHandle), or a custom com.sorrowblue.kioarch.SeekableSource:

import com.sorrowblue.kioarch.KioArch
import com.sorrowblue.kioarch.extractToByteArray
import kotlinx.io.files.Path

KioArch.createReader(Path("archive.7z")).use { reader ->
for (entry in reader.getEntries()) {
if (!entry.isDirectory) {
val bytes = entry.extractToByteArray(reader)
println("${entry.name}: ${bytes.size} bytes")
}
}
}

Core entry points, reader interfaces, seekable data sources, and exception hierarchy for reading archives across JVM, Android, iOS, JS, and WasmJs.

Quick Start

Use com.sorrowblue.kioarch.KioArch.createReader to open an archive from a file path, in-memory ByteArray, platform-specific descriptor (java.io.File, Android Uri / ParcelFileDescriptor, Apple NSData / NSURL / NSFileHandle), or a custom com.sorrowblue.kioarch.SeekableSource:

import com.sorrowblue.kioarch.KioArch
import com.sorrowblue.kioarch.extractToByteArray
import kotlinx.io.files.Path

KioArch.createReader(Path("archive.7z")).use { reader ->
for (entry in reader.getEntries()) {
if (!entry.isDirectory) {
val bytes = entry.extractToByteArray(reader)
println("${entry.name}: ${bytes.size} bytes")
}
}
}

Types

Link copied to clipboard

Thrown when an archive's headers, compressed streams, or CRC-32 checksums are corrupted.

Link copied to clipboard
data class ArchiveEntry(val index: Int, val name: String, val size: Long, val compressedSize: Long, val isDirectory: Boolean, val crc: Long)

Metadata describing a single file or directory entry within an archive.

Link copied to clipboard

Base exception hierarchy representing errors thrown during archive opening, inspection, or extraction in KioArch.

Link copied to clipboard

Archive and compression formats supported by KioArch.

Link copied to clipboard

Thrown when the input stream is not a recognized archive or invalid arguments are supplied to an archive operation.

Link copied to clipboard
class ArchiveIOException(message: String, cause: Throwable? = null) : ArchiveException

Thrown when an I/O failure occurs while reading from a SeekableSource, seeking within the archive, or writing decompressed bytes to a kotlinx.io.Sink.

Link copied to clipboard

Thrown when the native decompression engine fails to allocate required heap or dictionary memory.

Link copied to clipboard

Reads metadata and extracts entries on demand from an open archive.

Link copied to clipboard

Thrown when an archive uses an unsupported container format, compression codec, filter, or encryption scheme.

Link copied to clipboard

An in-memory SeekableSource backed directly by a ByteArray.

Link copied to clipboard

An ArchiveReader decorator returned when opening Bzip2-compressed archives (.bz2, .tar.bz2, .tbz2, and .tbz).

Link copied to clipboard

A JVM and Android extension of SeekableSource that transfers bytes directly into a NIO ByteBuffer, bypassing intermediate JVM heap ByteArray copies across the JNI boundary.

Link copied to clipboard

A JVM and Android DirectSeekableSource backed by a read-only RandomAccessFile and its underlying FileChannel.

Link copied to clipboard
actual object KioArch

Android implementation of KioArch backed by JNI bindings to libkioarch.so.

expect object KioArch

Entry point for creating ArchiveReader instances across all supported Kotlin Multiplatform targets.

actual object KioArch

iOS implementation of KioArch leveraging pure C archive decompression engine.

actual object KioArch

JS implementation of KioArch utilizing WebAssembly compiled from pure C archive engines.

actual object KioArch

JVM implementation of KioArch backed by JNI bindings to the native C decompression engine.

actual object KioArch

WasmJs implementation of KioArch utilizing WebAssembly compiled from pure C archive engines.

Link copied to clipboard

Jetpack App Startup Initializer that preloads the native libkioarch.so library via KioArch.loadLibrary when the Android application starts.

NodeFileSeekableSource
Link copied to clipboard
class NodeFileSeekableSource(pathStr: String) : SeekableSource

A Node.js-specific SeekableSource implementation for Kotlin/JS that performs synchronous random access via the Node.js fs module (openSync, readSync, fstatSync, closeSync).

class NodeFileSeekableSource(pathStr: String, module: JsAny) : SeekableSource

A Node.js-specific SeekableSource implementation for Kotlin/WasmJs that performs synchronous random access via the Node.js node:fs module (openSync, readSync, fstatSync, closeSync).

Link copied to clipboard

An Android-specific DirectSeekableSource wrapping a seekable ParcelFileDescriptor for Storage Access Framework (content://) or ContentProvider random access without copying files into cache storage.

Link copied to clipboard

A JVM and Android DirectSeekableSource backed by a read-only Java NIO FileChannel.

Link copied to clipboard

A random-access byte stream from which KioArch reads archive headers and compressed payloads.

Properties

Link copied to clipboard

Holds the active Emscripten WebAssembly module instance registered via KioArch.initialize.

Functions

Link copied to clipboard

Creates an ArchiveReader reading directly from a java.io.File via FileSeekableSource.

Creates an ArchiveReader directly from an Android ParcelFileDescriptor.

Creates an ArchiveReader directly from an Android content Uri resolved via context.contentResolver.

Link copied to clipboard
@ObjCName(name = "extract", swiftName = "extract")
fun ArchiveEntry.extract(reader: ArchiveReader, sink: Sink)

Extracts the uncompressed content of this entry from reader and writes it into sink.

Link copied to clipboard
@ObjCName(name = "extractToByteArray", swiftName = "extractToByteArray")
fun ArchiveEntry.extractToByteArray(reader: ArchiveReader): ByteArray

Extracts the uncompressed content of this entry from reader into a new in-memory ByteArray.

Link copied to clipboard

Returns the canonical lowercase file extensions for all archive formats supported by KioArch.

Link copied to clipboard
actual fun KioArch.initialize(module: Any)

Registers the instantiated Emscripten WebAssembly module with KioArch on the Kotlin/JS target.

actual fun KioArch.initialize(module: Any)

Registers the instantiated Emscripten WebAssembly module with KioArch on the Kotlin/WasmJs target and initializes the internal JS callback maps.

expect fun KioArch.initialize(module: Any)

Registers the instantiated Emscripten WebAssembly module with KioArch.

Link copied to clipboard

Loads and instantiates the Emscripten KioArch WebAssembly module on the Kotlin/JS target.

Loads and instantiates the Emscripten KioArch WebAssembly module on the Kotlin/WasmJs target.

Asynchronously loads and instantiates the Emscripten-compiled KioArch WebAssembly module.