static byte[] getNonRootIndexedKey(ByteBuff nonRootIndex, int i) {
      int numEntries = nonRootIndex.getInt(0);
      if (i < 0 || i >= numEntries) {
        return null;
      }

      // Entries start after the number of entries and the secondary index.
      // The secondary index takes numEntries + 1 ints.
      int entriesOffset = Bytes.SIZEOF_INT * (numEntries + 2);
      // Targetkey's offset relative to the end of secondary index
      int targetKeyRelOffset = nonRootIndex.getInt(Bytes.SIZEOF_INT * (i + 1));

      // The offset of the target key in the blockIndex buffer
      int targetKeyOffset = entriesOffset // Skip secondary index
        + targetKeyRelOffset // Skip all entries until mid
        + SECONDARY_INDEX_ENTRY_OVERHEAD; // Skip offset and on-disk-size

      // We subtract the two consecutive secondary index elements, which
      // gives us the size of the whole (offset, onDiskSize, key) tuple. We
      // then need to subtract the overhead of offset and onDiskSize.
      int targetKeyLength = nonRootIndex.getInt(Bytes.SIZEOF_INT * (i + 2)) - targetKeyRelOffset
        - SECONDARY_INDEX_ENTRY_OVERHEAD;

      // TODO check whether we can make BB backed Cell here? So can avoid bytes copy.
      return nonRootIndex.toBytes(targetKeyOffset, targetKeyLength);
    }
The indexed key at the ith position in the nonRootIndex. The position starts at 0.
@param i the ith position
@return The indexed key at the ith position in the nonRootIndex.
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlockIndex.java