package net.sergeych.bipack import kotlinx.serialization.KSerializer import kotlinx.serialization.serializer import net.sergeych.bintools.MotherPacker import net.sergeych.bintools.toDataSource import kotlin.reflect.KType class MotherBipack : MotherPacker { override fun pack(type: KType, payload: T): ByteArray { return BipackEncoder.encode(serializer(type), payload) } override fun unpack(type: KType, packed: ByteArray): T { return BipackDecoder.decode(packed.toDataSource(), serializer(type) as KSerializer) } }