toArray

fun Kapacity.toArray(init: (Int) -> Byte = { 0 }): Array<Byte>

Allocates a new boxed Array of Byte with a size equal to this capacity.

Warning on Truncation: Because Kotlin arrays are strictly indexed by Int, the maximum allowed size is Int.MAX_VALUE- 8 (approximately 2.14 GB). If this capacity exceeds that limit, the resulting array size will be silently truncated to Int.MAX_VALUE.

Return

A new boxed Array of Byte.

Parameters

init

A function used to compute the initial value of each array element based on its index.