FallbackMappedMemoryChunk

class FallbackMappedMemoryChunk(val path: String, val fileOffset: Long, data: ByteArray, dataOffset: Int = 0, val size: Long = (data.size - dataOffset).toLong()) : MappedMemoryChunk(source)

Fallback MappedMemoryChunk implementation backed by a heap ByteArray.

Used on platforms without native mmap support (JS, Wasm). The data is eagerly loaded into memory, so this does not provide the OS-paged benefits of a true memory-mapped file. It does, however, satisfy the MappedMemoryChunk contract so that code written against that interface works on all Kotlin Multiplatform targets.

Constructors

Link copied to clipboard
constructor(path: String, fileOffset: Long, data: ByteArray, dataOffset: Int = 0, size: Long = (data.size - dataOffset).toLong())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val fileOffset: Long

The byte offset within the file where the mapping starts.

Link copied to clipboard
open override val path: String

The file path this chunk is mapped from.

Link copied to clipboard
open override val size: Long

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun readByte(offset: Long): Byte
Link copied to clipboard
open override fun readBytes(offset: Long, length: Int): ByteArray
Link copied to clipboard
open override fun slice(offset: Long, length: Long): MemoryChunk