public void setBlocks(MockBlock... blocks) {
      file.blocks = blocks;
      int offset = 0;
      int i = 0;
      while (offset < file.length && i < blocks.length) {
        blocks[i].offset = offset;
        blocks[i].length = Math.min(file.length - offset, file.blockSize);
        offset += blocks[i].length;
        i += 1;
      }
    }
Set the blocks and their location for the file.
Must be called after the stream is closed or the block length will be
wrong.
@param blocks the list of blocks
ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestInputOutputFormat.java