Scoop API

scoop:scoop.platform:0.1.0

NativeByteBuffer

class NativeByteBuffer

source · line 28
public
public class NativeByteBuffer private constructor() : Closeable

Owned growable native byte storage with separate read and write positions. Outstanding native borrows restrict mutation and closure; explicitly close the buffer after use.

function compact

source · line 206
public
public fun compact(): Unit

Moves unread bytes to offset zero and resets positions around that content.

function readInt8

source · line 406
public
public fun readInt8(): Int8

Reads 1 bytes as Int8 and advances the read position.

function readUInt8

source · line 410
public
public fun readUInt8(): UInt8

Reads 1 bytes as UInt8 and advances the read position.

function readByte

source · line 279
public
public fun readByte(): Byte

Reads one byte and advances the read position.

function ensureWritable

source · line 169
public
public fun ensureWritable(count: Long): Unit

Grows storage when needed to provide at least count additional writable bytes, preserving positions and initialized content.

function close

source · line 633
public
public override fun close(): Unit

Releases native storage; an outstanding borrow prevents closure.

property writePosition

source · line 56
public
public val writePosition: Long

get: public read-only

The absolute offset immediately after initialized written bytes.

function clear

source · line 195
public
public fun clear(): Unit

Resets both positions to zero without promising to erase stored memory.