code: public static LongBuffer createLongBuffer(int elements)
      {
          ByteBuffer byteBuffer = ByteBuffer.allocateDirect(elements * 8);
          byteBuffer.order(ByteOrder.nativeOrder());
          return byteBuffer.asLongBuffer();
      }
docs: Creates a buffer for the given number of elements and
  native byte ordering
  
  @param elements The number of elements in the buffer
  @return The buffer