ImmutableBlob

class ImmutableBlob

An immutable compile-time array of bytes.

Functions

get
Link copied to clipboard
operator external fun get(index: Int): Byte
iterator
Link copied to clipboard
operator fun iterator(): ByteIterator

Creates an iterator over the elements of the array.

Properties

size
Link copied to clipboard
val size: Int

Extensions

asCPointer
Link copied to clipboard
fun ImmutableBlob.asCPointer(offset: Int = 0): CPointer<ByteVar>

Returns stable C pointer to data at certain offset, useful as a way to pass resource to C APIs.

asUCPointer
Link copied to clipboard
fun ImmutableBlob.asUCPointer(offset: Int = 0): CPointer<UByteVar>
toByteArray
Link copied to clipboard
external fun ImmutableBlob.toByteArray(startIndex: Int = 0, endIndex: Int = size): ByteArray

Copies the data from this blob into a new ByteArray.

toUByteArray
Link copied to clipboard
@ExperimentalUnsignedTypes
external fun ImmutableBlob.toUByteArray(startIndex: Int = 0, endIndex: Int = size): UByteArray

Copies the data from this blob into a new UByteArray.