code: public static UnsafeHeapBytes allocate(long size) {
      if (size > HeapMemory.MAX_SIZE)
        throw new IllegalArgumentException("size cannot for HeapBytes cannot be greater than " + HeapMemory.MAX_SIZE);
      return new UnsafeHeapBytes(HeapMemory.allocate(size));
    }
docs: Allocates a new heap byte array.
  <p>
  When the array is constructed, {@link HeapMemoryAllocator} will be used to allocate
  {@code count} bytes on the Java heap.
  
  @param size The count of the buffer to allocate (in bytes).
  @return The heap buffer.
  @throws IllegalArgumentException If {@code count} is greater than the maximum allowed count for
  an array on the Java heap - {@code Integer.MAX_VALUE - 5}