How square/okio works
Project type and purpose
• This is a Kotlin Multiplatform library (not an application) named Okio.
• Purpose: provide a modern, multiplatform abstraction over byte streams, file systems, and buffers to complement java.io and java.nio.
• It consists of a core API plus multiple platform‐specific implementations (JVM, JS, native, Android, WASI, Node.js, assets, fake filesystems), testing harnesses, benchmarks, and samples.
File structure
• Top‐level build & infra:
– Gradle wrapper & settings (gradle/, gradlew, settings.gradle.kts, libs.versions.toml)
– build-support module: helper code to generate BOMs, coordinate targets, share version logic
– .github workflows, .buildscript for docs and release
• Core module “okio”:
– src/commonMain: core interfaces (Buffer, ByteString, FileSystem, Path, Source, Sink, Timeout…)
– src/{jvm,js,native,…}Main: platform‐specific extensions & implementations
– src/commonTest & src/{jvm,js,native,…}Test: unit tests
• Platform modules:
– okio-fakefilesystem: in-memory FileSystem for testing
– okio-assetfilesystem: Android assets FS
– okio-nodefilesystem: Node.js FS adapter
– okio-wasifilesystem: WASI FS adapter
– okio-testing-support: reusable test fixtures & helpers for file systems
• Auxiliary modules:
– okio-bom: Bill of Materials for dependency management
– kotlin-js-store: ? (likely sample or plugin for JS)
– android-test: integration tests on Android
– samples: example code illustrating library usage
– jvm/jmh: benchmarks module
README for additional insights
• Confirms this is a library for data I/O, originally part of OkHttp.