Unframer

interface Unframer

Stateful inverse of Framer.frame. Implementations buffer partial frames across feed calls; each call returns zero or more complete payloads.

If the source stream ends with pendingBytes> 0, a partial frame was in flight when the stream closed. Callers that care about completeness should check this after the stream completes.

Not thread-safe.

Functions

Link copied to clipboard
abstract fun feed(bytes: ByteArray): List<ByteArray>
Link copied to clipboard
abstract fun pendingBytes(): Int