WasmPackage

data class WasmPackage(fileReader: FileReader) : WrapPackage, AutoCloseable

Implementation of the WrapPackage interface for Wasm Wrap packages

Parameters

fileReader

A FileReader instance used to read the package files, including the Wasm module and WRAP manifest

Constructors

Link copied to clipboard
constructor(manifestBuffer: ByteArray, wasmModule: ByteArray, fileReader: FileReader? = null)

Creates a new WasmPackage instance with the given manifest buffer and wasm module buffer.

constructor(manifestBuffer: ByteArray, fileReader: FileReader)

Creates a new WasmPackage instance with the given manifest buffer and file reader.

constructor(fileReader: FileReader, wasmModule: ByteArray)

Creates a new WasmPackage instance with the given wasm module and file reader.

constructor(fileReader: FileReader)

Properties

Link copied to clipboard
val ffiWrapPackage: <Error class: unknown class>

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard

Construct an instance of the package's Wasm Wrapper

Link copied to clipboard
open override fun getFile(path: String): Result<ByteArray>

Retrieves the file at the specified path within the Wrap package.

Link copied to clipboard
open override fun getManifest(): Result<WrapManifest>

Produce an instance of the WrapPackage's WRAP manifest

Link copied to clipboard

Reads the Wasm module from the Wrap package using the provided FileReader, and returns the module bytes