Class ForeignMemory

java.lang.Object
io.github.connellite.reflection.internal.ForeignMemory

public final class ForeignMemory extends Object
java.lang.foreign.MemorySegment bound by name so this library still compiles on Java 17. The handle stays null below Java 22 and when address() cannot be called.
  • Constructor Details

    • ForeignMemory

      public ForeignMemory()
  • Method Details

    • isAvailable

      public static boolean isAvailable()
    • addressOf

      public static long addressOf(ByteBuffer buffer) throws Throwable
      Returns:
      MemorySegment.ofBuffer(buffer).address(), which includes buffer.position()
      Throws:
      Throwable