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 Details

    • PanamaWasiStdio

      public PanamaWasiStdio(MemorySegment contextHandle)
      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:
      getStdin in interface ai.tegmentum.wasmtime4j.wasi.cli.WasiStdio
    • getStdout

      public ai.tegmentum.wasmtime4j.wasi.io.WasiOutputStream getStdout()
      Specified by:
      getStdout in interface ai.tegmentum.wasmtime4j.wasi.cli.WasiStdio
    • getStderr

      public ai.tegmentum.wasmtime4j.wasi.io.WasiOutputStream getStderr()
      Specified by:
      getStderr in interface ai.tegmentum.wasmtime4j.wasi.cli.WasiStdio