code: public static MappedMemory allocate(File file, FileChannel.MapMode mode, int size) {
      if (size > MAX_SIZE) {
        throw new IllegalArgumentException("size cannot be greater than " + MAX_SIZE);
      }
      return new MappedMemoryAllocator(file, mode).allocate(size);
    }
docs: Allocates memory mapped to a file on disk.
  
  @param file The file to which to map memory.
  @param mode The mode with which to map memory.
  @param size The count of the memory to map.
  @return The mapped memory.
  @throws IllegalArgumentException If {@code count} is greater than {@link MappedMemory#MAX_SIZE}