Class PanamaWasiStdio
java.lang.Object
ai.tegmentum.wasmtime4j.panama.wasi.cli.PanamaWasiStdio
- All Implemented Interfaces:
ai.tegmentum.wasmtime4j.wasi.cli.WasiStdio
public final class PanamaWasiStdio
extends Object
implements ai.tegmentum.wasmtime4j.wasi.cli.WasiStdio
Panama FFI implementation of the WasiStdio interface.
This class provides access to WASI Preview 2 standard I/O streams through Panama Foreign Function API calls to the native Wasmtime library.
This implementation ensures defensive programming to prevent native resource leaks and JVM crashes.
- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionPanamaWasiStdio(MemorySegment contextHandle) Creates a new Panama WASI stdio with the given native context handle. -
Method Summary
-
Constructor Details
-
PanamaWasiStdio
Creates a new Panama WASI stdio with the given native context handle.- Parameters:
contextHandle- the native context handle- Throws:
IllegalArgumentException- if context handle is null
-
-
Method Details
-
getStdin
public ai.tegmentum.wasmtime4j.wasi.io.WasiInputStream getStdin()- Specified by:
getStdinin interfaceai.tegmentum.wasmtime4j.wasi.cli.WasiStdio
-
getStdout
public ai.tegmentum.wasmtime4j.wasi.io.WasiOutputStream getStdout()- Specified by:
getStdoutin interfaceai.tegmentum.wasmtime4j.wasi.cli.WasiStdio
-
getStderr
public ai.tegmentum.wasmtime4j.wasi.io.WasiOutputStream getStderr()- Specified by:
getStderrin interfaceai.tegmentum.wasmtime4j.wasi.cli.WasiStdio
-