Class NativeBuffer

java.lang.Object
org.fusesource.leveldbjni.internal.NativeObject
org.fusesource.leveldbjni.internal.NativeBuffer

public class NativeBuffer extends NativeObject
A NativeBuffer allocates a native buffer on the heap. It supports creating sub slices/views of that buffer and manages reference tracking so that the the native buffer is freed once all NativeBuffer views are deleted.
  • Field Details

  • Constructor Details

  • Method Details

    • create

      public static NativeBuffer create(long capacity)
    • pushMemoryPool

      public static void pushMemoryPool(int size)
    • popMemoryPool

      public static void popMemoryPool()
    • create

      public static NativeBuffer create(byte[] data)
    • create

      public static NativeBuffer create(String data)
    • create

      public static NativeBuffer create(byte[] data, int offset, int length)
    • slice

      public NativeBuffer slice(long offset, long length)
    • cbytes

      static byte[] cbytes(String strvalue)
    • head

      public NativeBuffer head(long length)
    • tail

      public NativeBuffer tail(long length)
    • delete

      public void delete()
    • capacity

      public long capacity()
    • write

      public void write(long at, byte[] source, int offset, int length)
    • read

      public void read(long at, byte[] target, int offset, int length)
    • toByteArray

      public byte[] toByteArray()