private void overwriteHeader() {
    bufWithoutChecksum.rewind();
    blockType.write(bufWithoutChecksum);
    bufWithoutChecksum.putInt(onDiskSizeWithoutHeader);
    bufWithoutChecksum.putInt(uncompressedSizeWithoutHeader);
    bufWithoutChecksum.putLong(prevBlockOffset);
    if (this.fileContext.isUseHBaseChecksum()) {
      bufWithoutChecksum.put(fileContext.getChecksumType().getCode());
      bufWithoutChecksum.putInt(fileContext.getBytesPerChecksum());
      bufWithoutChecksum.putInt(onDiskDataSizeWithHeader);
    }
  }
Rewinds {@code buf} and writes first 4 header fields. {@code buf} position is modified as
side-effect.
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java