borrow

fun borrow(data: ByteArray, mutable: Boolean = false): BufferHandle.Borrowed(source)

Borrow a ByteArray without copying. Caller must ensure the array outlives the handle.


fun borrow(data: ByteArray, offset: Int, length: Int, mutable: Boolean = false): BufferHandle.Borrowed(source)

Borrow with offset and length.