W3cubDocs

/Kotlin

ImmutableBlob

Platform and version requirements: Native (1.3)
class ImmutableBlob

An immutable compile-time array of bytes.

Properties

Platform and version requirements: Native (1.3)

size

val size: Int

Functions

Platform and version requirements: Native (1.3)

get

operator fun get(index: Int): Byte
Platform and version requirements: Native (1.3)

iterator

Creates an iterator over the elements of the array.

operator fun iterator(): ByteIterator

Extension Functions

Platform and version requirements: Native (1.3)

asCPointer

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

fun ImmutableBlob.asCPointer(
    offset: Int = 0
): CPointer<ByteVar>
Platform and version requirements: Native (1.3)

asUCPointer

fun ImmutableBlob.asUCPointer(
    offset: Int = 0
): CPointer<UByteVar>
Platform and version requirements: Native (1.3)

toByteArray

Copies the data from this blob into a new ByteArray.

fun ImmutableBlob.toByteArray(
    startIndex: Int = 0, 
    endIndex: Int = size
): ByteArray
Platform and version requirements: Native (1.3)

toUByteArray

Copies the data from this blob into a new UByteArray.

fun ImmutableBlob.toUByteArray(
    startIndex: Int = 0, 
    endIndex: Int = size
): UByteArray

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native/-immutable-blob/index.html