BufferAccessor

Provides byte-level read access to a BufferHandle, regardless of its ownership mode.

This is the bridge between the storage model (which describes where bytes live) and code that needs to actually read those bytes. For BufferHandle.Owned and BufferHandle.Borrowed, access is direct. For BufferHandle.FileBacked, a platform-specific resolver maps the file region into memory.

Inheritors

Properties

Link copied to clipboard
abstract val sizeInBytes: Long

Total accessible bytes.

Functions

Link copied to clipboard

Read all bytes into a new array. Only practical for small buffers.

Link copied to clipboard
abstract fun readByte(offset: Long): Byte

Read a single byte at offset.

Link copied to clipboard
abstract fun readBytes(offset: Long, length: Int): ByteArray

Read length bytes starting at offset.