MultiplexedCodec
A trait that enables custom handling for encoding/decoding sequences.
Value members
Concrete methods
Repeatedly decodes values of type A
and returns a collection of the specified type.
Uses deMux
repeatedly to obtain the stream of vectors to decode to a value of type A
.
Terminates when the next stream to decode is empty or upon first decoding error.
Repeatedly decodes values of type A
and returns a collection of the specified type.
Uses deMux
repeatedly to obtain the stream of vectors to decode to a value of type A
.
Terminates when the next stream to decode is empty or upon first decoding error.
Note: For large sequences, it may be necessary to compact bits in deMux
.
- Value Params
- buffer
input bits
- deMux
returns
(next, rest)
tuples wherenext
is input todec
yielding(value, remainder)
andremainder ++ rest
is the next input todeMux
- dec
element decoder
Encodes all elements of the specified sequence and combines the results using mux
, or returns the first encountered error.
Encodes all elements of the specified sequence and combines the results using mux
, or returns the first encountered error.
- Value Params
- enc
element encoder
- mux
multiplexing function
- seq
elements to encode