Class Crc32c

  • All Implemented Interfaces:
    Checksum

    public final class Crc32c
    extends java.lang.Object
    implements Checksum
    Implementation of the Checksum interface that computes CRC-32C checksum.

    CRC-32C is defined in RFC 3720: Internet Small Computer Systems Interface (iSCSI).

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Crc32c INSTANCE
      Single instance to compute CRC-32C checksum.
      private static java.lang.invoke.MethodHandle UPDATE_DIRECT_BYTE_BUFFER  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Crc32c()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static int bitwiseComplement​(int value)  
      int compute​(long address, int offset, int length)
      Computes a checksum based on the contents of a java.nio.DirectByteBuffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INSTANCE

        public static final Crc32c INSTANCE
        Single instance to compute CRC-32C checksum.
      • UPDATE_DIRECT_BYTE_BUFFER

        private static final java.lang.invoke.MethodHandle UPDATE_DIRECT_BYTE_BUFFER
    • Constructor Detail

      • Crc32c

        private Crc32c()
    • Method Detail

      • bitwiseComplement

        private static int bitwiseComplement​(int value)
      • compute

        public int compute​(long address,
                           int offset,
                           int length)
        Computes a checksum based on the contents of a java.nio.DirectByteBuffer.
        Specified by:
        compute in interface Checksum
        Parameters:
        address - of the buffer.
        offset - within the buffer to begin at.
        length - of the data to read.
        Returns:
        computed checksum value.