clankerguru/opsx/okio

Claude Code and agent skill by clankerguru/opsx

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Okio I/O library by Square — the foundation kotlinx-io is based on. Reference for understanding kotlinx-io patterns.

Install

npx vskill@latest install clankerguru/opsx/okio

SKILL.md

The same SKILL.md was published earlier as clankerguru/opsx/okio.

When to use this skill

  • Understanding Okio patterns when reading third-party code or

documentation that uses Okio.

  • Mapping Okio concepts to their kotlinx-io equivalents.
  • Migrating existing Okio code to kotlinx-io.

When NOT to use this skill

  • Writing new code in this project — use kotlinx-io directly (see

/kotlinx-io skill).

Project convention

This project uses kotlinx-io exclusively. Do not add Okio as a dependency. This skill exists only as a reference for understanding the patterns that kotlinx-io inherits from Okio.


Core concepts

Okio provides the same layered I/O model that kotlinx-io adopted:

ConceptPurpose
BufferMutable byte buffer, implements both Source and Sink
SourceBuffered read interface
SinkBuffered write interface
ByteStringImmutable byte sequence with hex/base64/UTF-8 conversions
FileSystemMultiplatform file operations (read, write, list, move, delete)
PathMultiplatform file path

Okio calls its unbuffered types Source and Sink directly, then wraps them with .buffer() to get BufferedSource / BufferedSink. kotlinx-io renames these to RawSource / RawSink and .buffered().


Mapping table: Okio to kotlinx-io

Okiokotlinx-ioNotes
okio.Bufferkotlinx.io.BufferSame role, same API shape
okio.Sourcekotlinx.io.RawSourceUnbuffered read
okio.Sinkkotlinx.io.RawSinkUnbuffered write
okio.BufferedSourcekotlinx.io.SourceBuffered read
okio.BufferedSinkkotlinx.io.SinkBuffered write
.buffer().buffered()Wrap raw in buffered
okio.ByteStringkotlinx.io.bytestring.ByteStringImmutable bytes
"hex".decodeHex()ByteString(hexString)Hex decoding
byteString.hex()byteString.toHexString()Hex encoding
byteString.base64()(not built-in)Use java.util.Base64 on JVM
okio.FileSystemkotlinx.io.files.SystemFileSystemSingleton, not SYSTEM
okio.FileSystem.SYSTEMkotlinx.io.files.SystemFileSystemNo .SYSTEM accessor
okio.Pathkotlinx.io.files.PathSame concept
"path".toPath()Path("path")Construction
path / "child"path / "child"Same operator
fileSystem.source(path)SystemFileSystem.source(path)Returns raw, buffer it
fileSystem.sink(path)SystemFileSystem.sink(path)Returns raw, buffer it
fileSystem.appendingSink(p)SystemFileSystem.sink(p, append = true)Append mode
fileSystem.exists(path)SystemFileSystem.exists(path)Boolean
fileSystem.list(path)SystemFileSystem.list(path)Collection of Paths
fileSystem.createDirectories(p)SystemFileSystem.createDirectories(p)Recursive mkdir
fileSystem.delete(path)SystemFileSystem.delete(path)Delete file or empty dir
fileSystem.atomicMove(a, b)SystemFileSystem.atomicMove(a, b)Rename / move
fileSystem.metadata(path)SystemFileSystem.metadataOrNull(path)Returns nullable
source.readUtf8()source.readString()Read all as String
source.readUtf8Line()source.readLine()Read one line
source.readByteArray()source.readByteArray()Same
source.readByte()source.readByte()Same
source.readInt()source.readInt()Same (big-endian)
source.readIntLe()source.readIntLe()Same (little-endian)
source.readLong()source.readLong()Same (big-endian)
source.readLongLe()source.readLongLe()Same (little-endian)
source.readShort()source.readShort()Same (big-endian)
source.readShortLe()source.readShortLe()Same (little-endian)
source.readByteString()source.readByteString()Same
source.readDecimalLong()source.readDecimalLong()Same
source.readHexadecimalUnsignedLong()source.readHexadecimalUnsignedLong()Same
source.exhausted()source.exhausted()Same
source.indexOf(byte)source.indexOf(byte)Same
source.peek()source.peek()Same
source.skip(n)source.skip(n)Same
source.readAll(sink)source.transferTo(sink)Name changed
sink.writeUtf8(string)sink.writeString(string)Name changed
sink.writeByte(b)sink.writeByte(b)Same
sink.writeInt(i)sink.writeInt(i)Same
sink.writeIntLe(i)sink.writeIntLe(i)Same
sink.writeLong(l)sink.writeLong(l)Same
sink.writeLongLe(l)sink.writeLongLe(l)Same
sink.writeShort(s)sink.writeShort(s)Same
sink.writeShortLe(s)sink.writeShortLe(s)Same
sink.writeDecimalLong(l)sink.writeDecimalLong(l)Same
sink.writeHexadecimalUnsignedLong(l)sink.writeHexadecimalUnsignedLong(l)Same
sink.write(byteString)sink.write(byteString)Same
sink.write(byteArray)sink.write(byteArray)Same
sink.flush()sink.flush()Same
sink.emit()sink.emit()Same

When to use Okio vs kotlinx-io

SituationUse
New code in this projectkotlinx-io
Third-party library returns okio.SourceBridge at boundary, convert to kotlinx-io internally
OkHttp response body (returns Okio types)Use OkHttp's Okio types at the call site, convert to kotlinx-io for internal processing
Reading Okio documentation to understand a patternMap to kotlinx-io using the table above

Okio and kotlinx-io are not interchangeable at the type level -- you cannot pass an okio.Source where kotlinx.io.Source is expected. Bridge at the boundary using byte arrays or streams:

kotlin
// Okio Source → kotlinx-io Source (via InputStream bridge)
val kotlinxSource = okioSource.inputStream().asSource().buffered()
// kotlinx-io Source → Okio Source (via InputStream bridge)
val okioSource = kotlinxSource.asInputStream().source().buffer()

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/clankerguru/opsx/okio/badge)](https://verified-skill.com/skills/clankerguru/opsx/okio)

Something wrong with this skill or its page? Tell us.