private int computeTotalChecksumBytes() {
    // If the hfile block has minorVersion 0, then there are no checksum
    // data to validate. Similarly, a zero value in this.bytesPerChecksum
    // indicates that cached blocks do not have checksum data because
    // checksums were already validated when the block was read from disk.
    if (!fileContext.isUseHBaseChecksum() || this.fileContext.getBytesPerChecksum() == 0) {
      return 0;
    }
    return (int) ChecksumUtil.numBytes(onDiskDataSizeWithHeader,
      this.fileContext.getBytesPerChecksum());
  }
Return the number of bytes required to store all the checksums for this block. Each checksum
value is a 4 byte integer. <br/>
NOTE: ByteBuff returned by {@link HFileBlock#getBufferWithoutHeader()} and
{@link HFileBlock#getBufferReadOnly} or DataInputStream returned by
{@link HFileBlock#getByteStream()} does not include checksum.
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java