BleCodec

interface BleCodec<T> : BleEncoder<T> , BleDecoder<T>

Bidirectional codec combining BleEncoder and BleDecoder.

Functions

Link copied to clipboard

Bridge a BleDecoder to work with BleData input.

Link copied to clipboard

Bridge a BleEncoder to produce BleData via BleData factory.

Link copied to clipboard
fun <A, B> BleCodec<A>.bimap(encode: (B) -> A, decode: (A) -> B): BleCodec<B>

Transform both directions of this codec.

Link copied to clipboard
fun <A, B> BleEncoder<B>.contramap(transform: (A) -> B): BleEncoder<A>

Transform the input of this encoder.

Link copied to clipboard
abstract fun decode(data: ByteArray): T
Link copied to clipboard
abstract fun encode(value: T): ByteArray
Link copied to clipboard
fun <A, B> BleDecoder<A>.map(transform: (A) -> B): BleDecoder<B>

Transform the output of this decoder.