Scoop API

scoop:scoop.platform:0.1.0

NativeByteBorrow

class NativeByteBorrow

source · line 7
public
public class NativeByteBorrow internal constructor(
    owner: NativeByteBuffer,
    private val address: Ptr<Byte>?,
    /**
     * The maximum number of bytes covered by this borrow.
     */
    public val length: Long,
    private val writable: Boolean
)

An explicit native-buffer borrow retaining its owner until completion. It must be completed exactly once after all native access ends.

function complete

source · line 33
public
@Unsafe
    public fun complete(count: Long): Unit

Ends the borrow and advances the appropriate owner cursor by a valid consumed/produced count. Repeated completion is rejected.

function pointer

source · line 23
public
@Unsafe
    public fun pointer(): Ptr<Byte>?

Returns the borrowed native address, or None for an empty region. Access after completion is invalid.

property length

source · line 13
public
public val length: Long

get: public read-only

The maximum number of bytes covered by this borrow.