Borrowed

class Borrowed(val data: ByteArray, val offset: Int = 0, val sizeInBytes: Long = (data.size - offset).toLong(), val isMutable: Boolean = false) : BufferHandle(source)

A reference to externally-owned memory (e.g. a caller-supplied array). The runtime must not free or resize it. Mutation is possible only if the source explicitly permits it.

Constructors

Link copied to clipboard
constructor(data: ByteArray, offset: Int = 0, sizeInBytes: Long = (data.size - offset).toLong(), isMutable: Boolean = false)

Properties

Link copied to clipboard
Link copied to clipboard
open override val isMutable: Boolean

Whether this handle permits writing into the buffer.

Link copied to clipboard
val offset: Int
Link copied to clipboard
open override val ownership: Ownership

Ownership classification for diagnostics.

Link copied to clipboard
open override val sizeInBytes: Long

Total size in bytes of the accessible region.