Caution
⚠ Work-In-Progress.
API isn’t completely stable yet!
Benchmarks and complete test coverage are coming.
You can use snapshots from JitPack repository.
Library provides cross-platform RandomAccessData
abstraction for effective read-only random access to binary data.
Both suspend and blocking APIs are provided.
Different platform-specific implementations are provided.
Tip
For JVM and Android, compatibility with ByteBuffer
reads and writes is provided.
An InputStream
view is also provided for compatibility with existing APIs.
API | Platform | Supported for |
---|---|---|
ByteArray | All | All |
ByteBuffer | JVM, Android | JVM, Android |
ByteBufferMmap (memory-mapped file) |
JVM, Android | JVM, Android |
FileChannel | JVM, Android | JVM, Android |
RandomAccessFile | JVM, Android | JVM, Android |
SeekableByteChannel | JVM, Android | JVM, Android |
() -> InputStream Factory | JVM, Android | JVM, Android |
() -> DataInput Factory | JVM, Android | JVM, Android |
() -> ReadableByteChannel Factory | JVM, Android | JVM, Android |
AsynchronousFileChannel | JVM, Android | JVM, Android |
Important
For using AsynchronousFileChannel, you need to add Kotlin Coroutines dependency to your project.
History notes
The first steps of the implementation were dated 2021-03-31 (2d87ec044f5801cd3ad8cc31ac380b17fa31d44a).
Open-source since 2024-06-16.
Uses SemVer for versioning.
For the versions available, see the tags on this repository.
This project is licensed under the Apache License, Version 2.0 — see the license file for details.