code: private byte[] blockForWrite(int index) throws IOException {
      if (index >= blockCount) {
        int additionalBlocksNeeded = index - blockCount + 1;
        disk.allocate(this, additionalBlocksNeeded);
      }
  
      return blocks[index];
    }
docs: Gets the block at the given index, expanding to create the block if necessary.