Class Crc32

  • All Implemented Interfaces:
    Checksum

    public final class Crc32
    extends java.lang.Object
    implements Checksum
    Implementation of the Checksum interface that computes CRC-32 checksum.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Crc32 INSTANCE
      Singleton instance to compute CRC-32 checksum.
      private static java.lang.invoke.MethodHandle UPDATE_BYTE_BUFFER  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Crc32()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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 Crc32 INSTANCE
        Singleton instance to compute CRC-32 checksum.
      • UPDATE_BYTE_BUFFER

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

      • Crc32

        private Crc32()
    • Method Detail

      • 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.