ByteArrayBuilder

class ByteArrayBuilder(var data: ByteArray, size: Int = data.size, val allowGrow: Boolean = true)

Analogous to StringBuilder but for ByteArray. Allows to append values to end calling toByteArray. Provides some methods like s16LE or f32BE to append specific bit representations easily.

Constructors

Link copied to clipboard
constructor(initialCapacity: Int = 4096)
constructor(data: ByteArray, size: Int = data.size, allowGrow: Boolean = true)

Properties

Link copied to clipboard
val allowGrow: Boolean = true
Link copied to clipboard
Link copied to clipboard
var size: Int

Functions

Link copied to clipboard
inline fun append(v: Byte): ByteArrayBuilder
fun append(vararg v: Byte)
fun append(vararg v: Int): ByteArrayBuilder
fun append(array: ByteArray, offset: Int = 0, len: Int = array.size - offset)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun clear()
Link copied to clipboard
fun f16(v: Half, little: Boolean): ByteArrayBuilder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun f32(v: Float, little: Boolean): ByteArrayBuilder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun s16(v: Int, little: Boolean): ByteArrayBuilder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun s24(v: Int, little: Boolean): ByteArrayBuilder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun s32(v: Int, little: Boolean): ByteArrayBuilder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard