Fruchtfleisch

Kotlin bare decoder (maybe encoder)

bare                        kotlin
(https://git.sr.ht/~fsx/cbare/tree/main/item/src/cbare.c)
(https://datatracker.ietf.org/doc/draft-devault-bare/)
----------------------------------
uint                        ULong (https://en.wikipedia.org/wiki/LEB128#Unsigned_LEB128)
int                         Long
u8                          UByte (little-endian)
u16                         UShort
u32                         UInt
u64                         ULong
i8                          Byte (little-endian, two's complement)
i16                         Short
i32                         Int
i64                         Long
f32                         Float (IEEE754 binary32)
f64                         Double (IEEE754 binary64)
bool=u8(0|1)                Boolean
str=u8+[l]utf8byte          String
data=u8+[l]byte             List<Byte>
[l]data=[l]byte             ByteArray
void=empty                  (null)/Unit
enum=uint                   ULong -> enum class
optional<type>=bool+type    type?
list<type>=uint+[l]type     List<type>
[l]list<type>=[l]type       Array<type>
map<tA,tB>=uint+[l](tA,tB)  Map<tA, tB>
union=uint+type             type
struct=[]field              class