class ByteArrayBuilder
Helper class to assist with building byte arrays. Works similarly to StringBuilder.
ByteArrayBuilder(initialCap: Int = 128)
Helper class to assist with building byte arrays. Works similarly to StringBuilder. |
val size: Int
Returns current size of the buffer. |
fun append(byte: Byte): Unit
Appends a single byte to the buffer. fun append(array: ByteArray, srcRange: IntRange = array.indices): Unit
Appends a byte array to the buffer, optionally by only copying a section of it as specified by srcRange. |
|
fun build(): ByteArray
Copies the contents of the buffer to a new ByteArray and returns the new array. |