public class CrcCombineOnMarkChecksum extends Object implements SdkChecksum
This class allows combining two CRC values, making it efficient to update and restore the checksum during mark and reset operations. It is particularly useful in scenarios where a checksum needs to be marked, potentially reset to a previous state, and combined with additional data.
The class maintains an internal Checksum instance and uses a BiFunction to combine
two CRC values when necessary. The combine function is applied to a pair of CRC values, along with
the length of the data, to produce the resulting combined checksum.
| Constructor and Description |
|---|
CrcCombineOnMarkChecksum(Checksum checksum,
CrcCombineFunction crcCombineFunction) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getChecksumBytes()
Returns the computed checksum in a byte array rather than the long provided by
Checksum.getValue(). |
long |
getValue() |
void |
mark(int readLimit)
Allows marking a checksum for checksums that support the ability to mark and reset.
|
void |
reset() |
void |
update(byte[] b,
int off,
int len) |
void |
update(int b) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforAlgorithm, update, updatepublic CrcCombineOnMarkChecksum(Checksum checksum, CrcCombineFunction crcCombineFunction)
public byte[] getChecksumBytes()
SdkChecksumChecksum.getValue().getChecksumBytes in interface SdkChecksumpublic void mark(int readLimit)
SdkChecksummark in interface SdkChecksumreadLimit - the maximum limit of bytes that can be read before the mark position becomes invalid.Copyright © 2026. All rights reserved.