Okio Extensions
Latest stable Based on Bluetape4k release 1.11.0
Problem
Section titled “Problem”bluetape4k-okio is a high-performance I/O extension module built on Square’s Okio library. This manual connects that purpose to the current build, source entry points, tests, configuration resources, and lifecycle evidence instead of duplicating the README feature list.
When to use
Section titled “When to use”Use bluetape4k-okio when the application needs encoding boundaries, resource ownership, streaming, compatibility, and malformed input. Start with the source entry points below and confirm that their ownership and failure contracts match the calling component. Prefer a smaller standard-library or already-adopted module when it satisfies the same contract without another runtime boundary.
Coordinates
Section titled “Coordinates”dependencies { implementation(platform("io.github.bluetape4k:bluetape4k-dependencies:<version>")) implementation("io.github.bluetape4k:bluetape4k-okio")}Gradle project path: :bluetape4k-okio. Source directory: io/okio.
Concepts
Section titled “Concepts”The first source-level concepts to inspect are BufferSupport, BufferedSourceExtensions, ByteStringSupport, InputStreamSource, OkioConsts, OutputStreamSink, SinkSupport, and SourceSupport. File names are navigation anchors; read each declaration and its tests before treating it as a public contract.
Quick start
Section titled “Quick start”Add the coordinate above, refresh Gradle, and start from the smallest entry point that owns the required task. Open BufferSupport first; it is a concrete source entry point for the module.
API by task
Section titled “API by task”| Entry point | What to verify |
|---|---|
BufferSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
BufferedSourceExtensions | Inspect this declaration’s constructors, functions, and ownership contract. |
ByteStringSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
InputStreamSource | Inspect this declaration’s constructors, functions, and ownership contract. |
OkioConsts | Inspect this declaration’s constructors, functions, and ownership contract. |
OutputStreamSink | Inspect this declaration’s constructors, functions, and ownership contract. |
SinkSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
SourceSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
TimeoutSupport | Inspect this declaration’s constructors, functions, and ownership contract. |
AbstractBase64Sink | Inspect this declaration’s constructors, functions, and ownership contract. |
Patterns
Section titled “Patterns”The README evidence is organized around Overview, Why Okio, Sequence Diagrams, Compression Sink (One-Shot) — compress on close, Compression Sink (Streaming) — compress incrementally, Decompression Source (One-Shot) — decompress on first read, Tink Encryption + Compression Combined Flow, Coroutines Async File I/O Flow, Recommended Usage Scenarios, and Anti-Patterns. Use those topics as a navigation map, then confirm behavior in source and tests. Keep adoption narrow and connect owned resources to the caller lifecycle.
Integrations
Section titled “Integrations”The current build declares these integration edges:
api(project(":bluetape4k-core"))api(project(":bluetape4k-io"))compileOnly(project(":bluetape4k-tink"))api(libs.okio)compileOnly(libs.commons.codec)compileOnly(project(":bluetape4k-coroutines"))compileOnly(libs.kotlinx.coroutines.core)Treat compileOnly edges as caller-provided capabilities and verify runtime availability before using their APIs.
Configuration
Section titled “Configuration”No module-level configuration resource was found under src/main/resources. Configuration is supplied through constructors, builders, function arguments, or the integrating framework; confirm defaults in source.
Failures
Section titled “Failures”Failure semantics are defined by the linked entry points and tests, not inferred from the artifact name. Keep cancellation and timeout signals intact, close owned resources, and translate backend exceptions only at a boundary that can add a stable domain contract. Use the test anchors below to verify the exact behavior before adding retries or fallbacks.
Operations
Section titled “Operations”Track payload size, allocation, latency, malformed-input rate, resource closure, and protocol errors. Keep capacity, timeout, retry, and shutdown settings next to the component that owns the resource; avoid process-wide defaults that hide which caller accepted the trade-off.
Testing
Section titled “Testing”Run the module test task:
./gradlew :bluetape4k-okio:test --no-configuration-cacheRepresentative test anchors:
AbstractOkioTestBufferCursorKotlinTestBufferCursorTestBufferFactoryBufferKotlinTestBufferSupportTestBufferTestBufferedSinkTest
Workshops
Section titled “Workshops”No dedicated workshop path is registered in the manual manifest. Use the module README and the representative tests above as runnable evidence.
Limitations
Section titled “Limitations”This page documents the repository state represented by the linked source and tests. It does not turn optional backends into application defaults or claim performance without a benchmark artifact. Re-check compatibility and lifecycle notes when the module version changes.
Release diagrams
Section titled “Release diagrams”These diagrams are loaded directly from README assets published with the 1.11.0 release and pinned to its immutable commit. They describe this manual’s released structure and runtime flows, not later Snapshot changes. Select a preview to open the SVG at the same release commit.
Sink / Source Adapter Hierarchy diagram
Section titled “Sink / Source Adapter Hierarchy diagram”Release README: io/okio/README.md
NIO Channel Adapter Hierarchy diagram
Section titled “NIO Channel Adapter Hierarchy diagram”Release README: io/okio/README.md
Coroutines Async I/O Hierarchy diagram
Section titled “Coroutines Async I/O Hierarchy diagram”Release README: io/okio/README.md
Compression Factory (Compressable) diagram
Section titled “Compression Factory (Compressable) diagram”Release README: io/okio/README.md
Compression Sink (One-Shot) — compress on close diagram
Section titled “Compression Sink (One-Shot) — compress on close diagram”Release README: io/okio/README.md
Compression Sink (Streaming) — compress incrementally diagram
Section titled “Compression Sink (Streaming) — compress incrementally diagram”Release README: io/okio/README.md
Decompression Source (One-Shot) — decompress on first read diagram
Section titled “Decompression Source (One-Shot) — decompress on first read diagram”Release README: io/okio/README.md
Tink Encryption + Compression Combined Flow diagram
Section titled “Tink Encryption + Compression Combined Flow diagram”Release README: io/okio/README.md
Coroutines Async File I/O Flow diagram
Section titled “Coroutines Async File I/O Flow diagram”Release README: io/okio/README.md








