Class NativeBuffer

java.lang.Object
org.maplibre.nativejni.render.NativeBuffer
All Implemented Interfaces:
AutoCloseable

public final class NativeBuffer extends Object implements AutoCloseable
Explicit off-heap byte buffer for reusable native readback and upload storage.

The JNI implementation stores bytes in a direct ByteBuffer, so capacity is limited to Integer.MAX_VALUE bytes. Closing the buffer invalidates this wrapper immediately; the JVM releases the direct-buffer memory according to its own buffer and garbage-collection lifecycle.

  • Method Details

    • allocate

      public static NativeBuffer allocate(long byteLength)
    • byteLength

      public long byteLength()
    • toByteArray

      public byte[] toByteArray()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable