private boolean checkDataIntegrityInByteBufferWithCRC(ByteBuffer byteBuffer) {
    byteBuffer.position(0);
    byteBuffer.limit(byteBuffer.capacity() - CRC_FIELD_LENGTH);
    CRC32 crc = new CRC32();
    crc.update(byteBuffer.slice());
    // reset the limit
    byteBuffer.limit(byteBuffer.capacity());
    return crc.getValue() == byteBuffer.getLong(byteBuffer.capacity() - CRC_FIELD_LENGTH);
  }
Check integrity of data in byte buffer by comparing the CRC. The CRC should be stored in the last few
bytes.
@param byteBuffer The byte buffer
@return {@code true} if the crc matches.
ambry-store/src/main/java/com/github/ambry/store/IndexSegment.java