private int length(int off, long max) {
    return (int) Math.min(disk.blockSize() - off, max);
  }
Gets the block at the given index, expanding to create the block if necessary.
jimfs/src/main/java/com/google/common/jimfs/RegularFile.java