use of io.aeron.archive.checksum.Checksum in project aeron by real-logic.
the class Catalog method updateChecksum.
void updateChecksum(final int recordingDescriptorOffset) {
final Checksum checksum = this.checksum;
if (null != checksum) {
final UnsafeBuffer headerBuffer = this.headerAccessBuffer;
final int recordingLength = headerBuffer.getInt(recordingDescriptorOffset + RecordingDescriptorHeaderEncoder.lengthEncodingOffset(), BYTE_ORDER);
final int checksumValue = checksum.compute(catalogByteBufferAddress, DESCRIPTOR_HEADER_LENGTH + recordingDescriptorOffset, recordingLength);
headerBuffer.putInt(recordingDescriptorOffset + RecordingDescriptorHeaderEncoder.checksumEncodingOffset(), checksumValue, BYTE_ORDER);
}
}
Aggregations