https://github.com/karmakrafts/kmmio
Lightweight MMIO for Kotlin Multiplatform.
https://github.com/karmakrafts/kmmio
api kotlin kotlin-library kotlin-multiplatform kotlin-native library linux macos memory memory-management memory-mapped-file memory-mapping mingw mmio osx windows
Last synced: 27 days ago
JSON representation
Lightweight MMIO for Kotlin Multiplatform.
- Host: GitHub
- URL: https://github.com/karmakrafts/kmmio
- Owner: karmakrafts
- License: apache-2.0
- Created: 2024-11-08T22:56:16.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2026-01-31T23:58:39.000Z (4 months ago)
- Last Synced: 2026-02-01T10:56:30.384Z (4 months ago)
- Topics: api, kotlin, kotlin-library, kotlin-multiplatform, kotlin-native, library, linux, macos, memory, memory-management, memory-mapped-file, memory-mapping, mingw, mmio, osx, windows
- Language: Kotlin
- Homepage: https://git.karmakrafts.dev/kk/kmmio
- Size: 385 KB
- Stars: 18
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# kMMIO
[](https://git.karmakrafts.dev/kk/kmmio/-/pipelines)
[](https://git.karmakrafts.dev/kk/kmmio/-/packages)
[](https://git.karmakrafts.dev/kk/kmmio/-/packages)
[](https://kotlinlang.org/)
[](https://docs.karmakrafts.dev/kmmio-core)
Lightweight memory mapped IO for Kotlin Multiplatform on JVM, Android and native.
If you need random access on big files, this is the library you're looking for!
This library also comes with [kotlinx.io](https://github.com/Kotlin/kotlinx-io) integration out of the box.
### How to use it
First, add the official Maven Central repository to your settings.gradle.kts:
```kotlin
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}
```
Then add a dependency on the library in your buildscript:
```kotlin
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("dev.karmakrafts.kmmio:kmmio-core:")
}
}
}
}
```
### Code example
```kotlin
fun main() {
VirtualMemory(4096, path).use {
it.source() // Consume data through a kotlinx.io.Source
it.sink() // Produce data through a kotlinx.io.Sink
}
}
```