Codec

interface Codec<T> : Encoder<T> , Decoder<T> , FrameDetector

Convenience union of Encoder, Decoder, and FrameDetector.

Send-only consumers can implement just Encoder; receive-only consumers just Decoder or SuspendingDecoder. Generated code emits whichever subset the consumer's per-field path-reachability requires.

Inheritors

Functions

Link copied to clipboard
abstract fun decode(buffer: ReadBuffer, context: DecodeContext): T
Link copied to clipboard
abstract fun encode(buffer: WriteBuffer, value: T, context: EncodeContext)
Link copied to clipboard
open fun peekFrameSize(stream: StreamProcessor, baseOffset: Int = 0): PeekResult
Link copied to clipboard
open fun wireSize(value: T, context: EncodeContext): WireSize

Reports the on-wire byte size. Defaults to WireSize.BackPatch.