encodeToByteArray

fun <T> encodeToByteArray(serializer: SerializationStrategy<T>, value: T): ByteArray

Encode a value to a byte array according to the BCS specification.

Return

The encoded value as a byte array.

Parameters

serializer

The serializer to use to encode the value.

value

The value to encode.


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

Encode a value to a byte array according to the BCS specification.

This is an inline overload convenience method to avoid the need to explicitly pass a serializer.

Return

The encoded value as a byte array.

Parameters

value

The value to encode.