code: public static DirectBytes allocate(long size) {
      if (size > HeapMemory.MAX_SIZE)
        throw new IllegalArgumentException("size cannot for DirectBytes cannot be greater than " + HeapMemory.MAX_SIZE);
      return new DirectBytes(ByteBuffer.allocate((int) size));
    }
docs: Allocates a new direct byte array.
  
  @param size The count of the buffer to allocate (in bytes).
  @return The direct 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}