encodeToByteArray

inline fun <T> BinaryFormat.encodeToByteArray(value: T): ByteArray

Serializes and encodes the given value to byte array using serializer retrieved from the reified type parameter.