Interface SdkChecksum
- All Superinterfaces:
- Checksum
- All Known Implementing Classes:
- BaseCrcChecksum,- ConstantChecksum,- Crc32Checksum,- Crc64NvmeChecksum,- CrcCloneOnMarkChecksum,- CrcCombineOnMarkChecksum,- DigestAlgorithmChecksum
Extension of 
Checksum to support checksums and checksum validations used by the SDK that are not provided by the JDK.- 
Method SummaryModifier and TypeMethodDescriptionstatic SdkChecksumforAlgorithm(ChecksumAlgorithm algorithm) Returns anSdkChecksumbased on theChecksumAlgorithmprovided.byte[]Returns the computed checksum in a byte array rather than the long provided byChecksum.getValue().voidmark(int readLimit) Allows marking a checksum for checksums that support the ability to mark and reset.default voidupdate(byte[] b) Updates the current checksum with the specified array of bytes.default voidupdate(ByteBuffer buffer) Updates the current checksum with the bytes from the specified buffer.
- 
Method Details- 
forAlgorithmReturns anSdkChecksumbased on theChecksumAlgorithmprovided. UnsupportedOperationException will be thrown for unsupported algorithm.
- 
getChecksumBytesbyte[] getChecksumBytes()Returns the computed checksum in a byte array rather than the long provided byChecksum.getValue().- Returns:
- byte[] containing the checksum
 
- 
markvoid mark(int readLimit) Allows marking a checksum for checksums that support the ability to mark and reset.- Parameters:
- readLimit- the maximum limit of bytes that can be read before the mark position becomes invalid.
 
- 
updatedefault void update(byte[] b) Updates the current checksum with the specified array of bytes.- Parameters:
- b- the array of bytes to update the checksum with
- Throws:
- NullPointerException- if- bis- null
 
- 
updateUpdates the current checksum with the bytes from the specified buffer.The checksum is updated with the remaining bytes in the buffer, starting at the buffer's position. Upon return, the buffer's position will be updated to its limit; its limit will not have been changed. - Parameters:
- buffer- the ByteBuffer to update the checksum with
- Throws:
- NullPointerException- if- bufferis- null
 
 
-