// the find
square/okio
A modern I/O library for Android, Java, and Kotlin Multiplatform.
Okio is Square's I/O library for JVM and Kotlin Multiplatform, built originally to power OkHttp. It replaces java.io and java.nio with a cleaner API centered on Buffer, Source, and Sink — plus ByteString for immutable byte sequences. If you write Kotlin that touches files, sockets, or streams, you're probably already using this transitively.
The Buffer implementation is genuinely good: segment pooling avoids allocation pressure, and zero-copy moves between buffers mean you can chain transforms without copying bytes. FakeFileSystem ships as a first-class testing artifact — you get a full in-memory filesystem with clock control, which makes file-system-touching code actually testable. The KMP story is real: JVM, Android, iOS, Linux, WASM-WASI, and Node.js all share the same FileSystem abstraction, and the platform-specific impls are thin. Hash functions (MD5, SHA-1, SHA-256, SHA-512, HMAC) are built in and pipe through the same Source/Sink model, so you don't need a separate dependency.
The README is nearly empty — just 'see the website' — which is fine if the website exists, but it's a bad sign for discoverability and offline use. The FileSystem API is still marked @ExperimentalFileSystem in some targets, meaning it can change under you across minor versions. No async/coroutine-native Source or Sink: everything is blocking, so if you're writing suspend-heavy code you'll end up wrapping Okio in withContext(Dispatchers.IO) everywhere rather than getting proper async support. CipherSink and CipherSource are JVM-only — no crypto streams on Native or JS.