buildByteArray

fun buildByteArray(order: ByteOrder = ByteOrder.LEAST_SIGNIFICANT_FIRST, expectedSize: Int = Long.SIZE_BYTES, block: ByteArrayBuilder.() -> Unit): ByteArray

Builds a ByteArray using a ByteArrayBuilder

Return

the built ByteArray

Parameters

order

the ByteOrder in which to add to the ByteArray. This is the default order in which elements will be encoded.

expectedSize

the initial size the ByteArray will use to approximate its final size.

block

the building block using ByteArrayBuilder to build the array.