Class ComponentLowerer

java.lang.Object
ai.tegmentum.webassembly4j.runtime.component.ComponentLowerer

public final class ComponentLowerer extends Object
Extracts the first core WASM module from a component model binary.

The component binary format (\0asm\x0d\x00\x01\x00) contains sections, each with a 1-byte ID and LEB128-encoded size. Section ID 1 contains an embedded core WASM module as a complete binary.

This is a pure Java implementation — no external tools required.

  • Method Details

    • lower

      public static byte[] lower(byte[] componentBytes)
      Extracts the first core module from a component binary.
      Parameters:
      componentBytes - the component model WASM binary
      Returns:
      the core module bytes
      Throws:
      IllegalArgumentException - if the bytes are not a valid component or contain no core module