code: public ByteBuffer getByteBuffer()
      {
          if (buffer == null)
          {
              return null;
          }
          if (!(buffer instanceof ByteBuffer))
          {
              return null;
          }
          ByteBuffer internalByteBuffer = (ByteBuffer)buffer;
          ByteBuffer byteBuffer = internalByteBuffer.slice();
          return byteBuffer.order(ByteOrder.nativeOrder());
      }
docs: Returns a ByteBuffer that corresponds to the memory that this
  pointer points to.<br>
  <br>
  The returned byte buffer will have the byte order that is implied
  by <code>ByteOrder#nativeOrder()</code>. It will be a slice of the
  buffer that is stored internally. So it will share the same memory,
  but its position and limit will be independent of the internal buffer.
  <br>
  This function may only be applied to pointers that have been set to
  point to a region of host- or unified memory using one of these
  methods:
  <ul>
  <li>{@link jcuda.driver.JCudaDriver#cuMemAllocHost}</li>
  <li>{@link jcuda.driver.JCudaDriver#cuMemHostAlloc}</li>
  <li>{@link jcuda.driver.JCudaDriver#cuMemAllocManaged}</li>
  <li>{@link jcuda.runtime.JCuda#cudaMallocHost}</li>
  <li>{@link jcuda.runtime.JCuda#cudaHostAlloc}</li>
  <li>{@link jcuda.runtime.JCuda#cudaMallocManaged}</li>
  <li>{@link Pointer#to(byte[])}</li>
  </ul>
  <br>
  For other pointer types, <code>null</code> is returned.
  
  @return The byte buffer