@Override
    public void close() throws IOException {
      super.close();
      DataOutputBuffer buf = (DataOutputBuffer) getWrappedStream();
      file.length = buf.getLength();
      file.content = new byte[file.length];
      MockBlock block = new MockBlock("host1");
      block.setLength(file.length);
      setBlocks(block);
      System.arraycopy(buf.getData(), 0, file.content, 0, file.length);
    }
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
common/src/test/org/apache/hive/common/util/MockFileSystem.java