private void writeRoot(BlockIndexChunk blockIndexChunk, DataOutput out) throws IOException {
    for (int i = 0; i < blockIndexChunk.getNumEntries(); ++i) {
      out.writeLong(blockIndexChunk.getBlockOffset(i));
      out.writeInt(blockIndexChunk.getOnDiskDataSize(i));
      Bytes.writeByteArray(out, blockIndexChunk.getBlockKey(i));
    }
  }
Writes this chunk into the given output stream in the root block index format. This format is
similar to the {@link HFile} version 1 block index format, except that we store on-disk size of
the block instead of its uncompressed size.
@param out the data output stream to write the block index to. Typically a stream writing into
           an {@link HFile} block.
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/NoOpIndexBlockEncoder.java