Class WasmBinaryInfo

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

public final class WasmBinaryInfo extends Object
Detects whether a WASM binary is a core module or a component.

Both use the \0asm magic prefix. Core modules have version bytes 01 00 00 00 at offset 4. Components have a layer byte of 0x0d at offset 4 per the component model binary format.

  • Method Details

    • isComponent

      public static boolean isComponent(byte[] bytes)
    • isCoreModule

      public static boolean isCoreModule(byte[] bytes)