ByteByByteFrameParser

class ByteByByteFrameParser(unpacker: (b: Byte) -> List<ByteArray>, resetUnpacker: () -> Unit? = null) : FrameParser(source)

Parser that calls a functional unpacker with each byte. The unpacker must maintain its internal state and return 0..N complete frames on each feed(byte) call.

Constructors

Link copied to clipboard
constructor(unpacker: (b: Byte) -> List<ByteArray>, resetUnpacker: () -> Unit? = null)

Functions

Link copied to clipboard
open override fun appendAndExtract(data: ByteArray): List<ByteArray>

Append incoming bytes and return a list of complete frames extracted.

Link copied to clipboard
open override fun reset()

Clear internal state.