Package-level declarations

Types

Link copied to clipboard
interface Codec<T> : Encoder<T> , Decoder<T> , FrameDetector

Complete codec: encodes, decodes, and detects frame boundaries.

Link copied to clipboard
interface CodecContext

Base interface for typed key-value context that flows through codec chains.

Link copied to clipboard

Context passed to Codec.decode for runtime configuration during decoding.

Link copied to clipboard
fun interface Decoder<out T>

Decodes typed messages from bytes.

Link copied to clipboard

Context passed to Codec.encode for runtime configuration during encoding.

Link copied to clipboard
interface Encoder<in T>

Encodes typed messages to bytes.

Link copied to clipboard
sealed interface SizeEstimate

Result of estimating the encoded size of a message.

Functions

Link copied to clipboard
fun <T> Codec<T>.encodeToBuffer(value: T, factory: BufferFactory = BufferFactory.Default, context: EncodeContext = EncodeContext.Empty): ReadBuffer
Link copied to clipboard
fun <T> Codec<T>.testRoundTrip(value: T, expectedBytes: ByteArray? = null, factory: BufferFactory = BufferFactory.Default, decodeContext: DecodeContext = DecodeContext.Empty, encodeContext: EncodeContext = EncodeContext.Empty): T

Testing utility: encodes value, optionally verifies the wire bytes match expectedBytes, then decodes and returns the result. Intended for use in test suites to validate codec correctness.