Interface UnixFSChecksumAlgorithm.Checkable

All Known Implementing Classes:
UnixFSDataHeader
Enclosing class:
UnixFSChecksumAlgorithm

public static interface UnixFSChecksumAlgorithm.Checkable
Defines a Checksum-able Struct type.
  • Method Summary

    Modifier and Type
    Method
    Description
    javolution.io.Struct.Unsigned32
    Returns the member of the struct containing the checksum.
    default ByteBuffer
    Returns a ByteBuffer of the Struct's contents positioned appropriately for the the algorithm.
  • Method Details

    • checksum

      javolution.io.Struct.Unsigned32 checksum()
      Returns the member of the struct containing the checksum. Calculation presumes that for verification this member will be set to zero before calculating the checksum, and that this value will be skipped when verifying the checksum. Additionally, the checker and validator both assume that this member falls somewhere inside the ByteBuffer returned by contentsToCheck().
      Returns:
      the checksum member
    • contentsToCheck

      default ByteBuffer contentsToCheck()
      Returns a ByteBuffer of the Struct's contents positioned appropriately for the the algorithm. The returned value must have the position and limit set appropriately to perform the checksum calculation. The position must be the beginning of the Struct and the limit must be set to the final region of data to check (which may exceed the size of the Struct).
      Returns:
      the ByteBuffer