
Async suspend-based streaming I/O layer exposing AsyncFileSystem/AsyncReadOnlyFileSystem, AsyncCloseable, async raw sources/sinks, buffered AsyncSource, AwaitPredicate, virtual/noop/system filesystems, random/discarding streams, portable implementations.
Streaming Suspend Input Output library for Kotlin Multiplatform.
This is an async IO extension for kotlinx.io based on the async API proposal.
AsyncReadOnlyFileSystem interfaceAsyncFileSystem interfaceAsyncCloseable interfaceAsyncRawSource interfaceAsyncRawSink interfaceAsyncSource wrapper for buffering raw async sourcesAwaitPredicate interface for await conditions like exhausted and available
DiscardingAsyncSink object for voiding dataRandomAsyncSource object for sourcing an endless pseudo-random byte streamAsyncSystemFileSystem global file system instance via the ssio-core moduleAsyncVirtualFileSystem class via the ssio-vfs moduleAsyncNoopFileSystem object via the ssio-noop moduleThe following matrix illustrates what implementations are used for which target & runtime combination
in the ssio-core implementation:
| Target | Runtime | Implementation |
|---|---|---|
| JVM | JVM | NIO |
| Android | ART | NIO |
| Linux | Kotlin/Native | CIO/io_uring* |
| Windows | Kotlin/Native | CIO |
| macOS | Kotlin/Native | CIO |
| iOS | Kotlin/Native | CIO |
| tvOS | Kotlin/Native | CIO |
| watchOS | Kotlin/Native | CIO |
| JS | Browser | OPFS |
| JS | NodeJS | fs.promises |
| WASM | Browser | OPFS |
| WASM | NodeJS | fs.promises |
NOTE: Implementations marked with an asterisk* are used only when the underlying system supports them.
The answer is simple: you shouldn't if you don't need a suspend IO API available in your common source set.
If you do, this library is probably what you're looking for.
First, add the official Maven Central repository to your settings.gradle.kts:
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}Then add a dependency on the library in your root buildscript:
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("dev.karmakrafts.ssio:ssio-core:<version>")
}
}
}
}Or, if you are only using Kotlin/JVM, add it to your top-level dependencies block instead.
Streaming Suspend Input Output library for Kotlin Multiplatform.
This is an async IO extension for kotlinx.io based on the async API proposal.
AsyncReadOnlyFileSystem interfaceAsyncFileSystem interfaceAsyncCloseable interfaceAsyncRawSource interfaceAsyncRawSink interfaceAsyncSource wrapper for buffering raw async sourcesAwaitPredicate interface for await conditions like exhausted and available
DiscardingAsyncSink object for voiding dataRandomAsyncSource object for sourcing an endless pseudo-random byte streamAsyncSystemFileSystem global file system instance via the ssio-core moduleAsyncVirtualFileSystem class via the ssio-vfs moduleAsyncNoopFileSystem object via the ssio-noop moduleThe following matrix illustrates what implementations are used for which target & runtime combination
in the ssio-core implementation:
| Target | Runtime | Implementation |
|---|---|---|
| JVM | JVM | NIO |
| Android | ART | NIO |
| Linux | Kotlin/Native | CIO/io_uring* |
| Windows | Kotlin/Native | CIO |
| macOS | Kotlin/Native | CIO |
| iOS | Kotlin/Native | CIO |
| tvOS | Kotlin/Native | CIO |
| watchOS | Kotlin/Native | CIO |
| JS | Browser | OPFS |
| JS | NodeJS | fs.promises |
| WASM | Browser | OPFS |
| WASM | NodeJS | fs.promises |
NOTE: Implementations marked with an asterisk* are used only when the underlying system supports them.
The answer is simple: you shouldn't if you don't need a suspend IO API available in your common source set.
If you do, this library is probably what you're looking for.
First, add the official Maven Central repository to your settings.gradle.kts:
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}Then add a dependency on the library in your root buildscript:
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("dev.karmakrafts.ssio:ssio-core:<version>")
}
}
}
}Or, if you are only using Kotlin/JVM, add it to your top-level dependencies block instead.