code: public static HeapBytes allocate(int size) {
      if (size > MAX_SIZE) {
        throw new IllegalArgumentException("size cannot for HeapBytes cannot be greater than " + MAX_SIZE);
      }
      return new HeapBytes(ByteBuffer.allocate((int) size));
    }
docs: Allocates a new heap byte array.
  
  @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}