Package-level declarations
Types
Built-in Codec for 7-bit ASCII text (US-ASCII, RFC 20). One byte per character on the wire, range 0x00..0x7F.
Canonical DecodeContext / EncodeContext key for the consumer-supplied BufferFactory codecs should use when allocating consumer-owned buffers.
Marker for typed key-value context that flows through codec chains.
Context passed to Decoder.decode / SuspendingDecoder.decode for runtime configuration (allocator hints, max-size guards, version pins, etc.). Contexts are immutable; with returns a new context.
Open base class for decode failures. Protocol layers subclass and attach domain-specific fields (e.g., MqttReasonCode, WebSocketCloseCode).
Key visible only to DecodeContext. Define as a Kotlin object.
Context passed to Encoder.encode for runtime configuration. Contexts are immutable; with returns a new context.
Open base class for encode failures. Protocol layers subclass and attach domain-specific fields.
Key visible only to EncodeContext. Define as a Kotlin object.
Runtime entry point for the @FramedBy slicing-scheme encode emit. The KSP-generated @FramedBy codec calls encode, which:
Peeks the next frame size from a StreamProcessor without consuming bytes. Streaming loops use this to gate calls to the synchronous Decoder.
Opaque, platform-typed handle for bytes that need to outlive the wire frame they were decoded from — IPC forwarding, persistence, debug capture, default-decode for payloads whose codec isn't pinned at decode time.
JVM + Android actual for OwnedBytesHandle. See common kdoc for design rationale; both jvm and androidTarget source-sets dependsOn jvmCommonMain so this single file serves both.
Canonical Codec for OwnedBytesHandle. Implements buffer-v1 Pattern #2: decode allocates a consumer-owned PlatformBuffer via the factory bound to BufferFactoryKey (falling back to ownedBytesFallbackFactory — BufferFactory.Default on every platform), copies the remaining wire bytes into it, and wraps the result in an OwnedBytesHandle. Encode writes the handle's bytes into the target buffer; wireSize is WireSize.Exact of the carried byte count.
Result of peeking a frame size from a StreamProcessor.
Reads T asynchronously from a pre-bounded ReadBuffer slice.
Functions
Returns a ReadBuffer view over the bytes storage, position reset to 0. The returned view aliases the handle's internal buffer — do not free.
Number of bytes carried by this handle.
Content-equality across two handles.
Content hash.
Platform-safe fallback BufferFactory for OwnedBytesHandleCodec when the DecodeContext does not carry a BufferFactoryKey.
Construct from a consumer-owned PlatformBuffer. The platform actual takes ownership of bytes and is responsible for its lifetime.