Class Buffer


  • @UnstableApi
    public final class Buffer
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int addressSize()
      Returns the size of a pointer.
      static java.nio.ByteBuffer allocateDirectWithNativeOrder​(int capacity)
      Returns a new ByteBuffer which has the same ByteOrder as the native order of the machine.
      static void free​(java.nio.ByteBuffer buffer)
      Free the direct ByteBuffer.
      static long memoryAddress​(java.nio.ByteBuffer buffer)
      Returns the memory address of the given direct ByteBuffer.
      static java.nio.ByteBuffer wrapMemoryAddress​(long memoryAddress, int capacity)  
      static java.nio.ByteBuffer wrapMemoryAddressWithNativeOrder​(long memoryAddress, int capacity)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • free

        public static void free​(java.nio.ByteBuffer buffer)
        Free the direct ByteBuffer.
      • allocateDirectWithNativeOrder

        public static java.nio.ByteBuffer allocateDirectWithNativeOrder​(int capacity)
        Returns a new ByteBuffer which has the same ByteOrder as the native order of the machine.
      • memoryAddress

        public static long memoryAddress​(java.nio.ByteBuffer buffer)
        Returns the memory address of the given direct ByteBuffer.
      • addressSize

        public static int addressSize()
        Returns the size of a pointer.
      • wrapMemoryAddressWithNativeOrder

        public static java.nio.ByteBuffer wrapMemoryAddressWithNativeOrder​(long memoryAddress,
                                                                           int capacity)
      • wrapMemoryAddress

        public static java.nio.ByteBuffer wrapMemoryAddress​(long memoryAddress,
                                                            int capacity)