Class Crc32


  • final class Crc32
    extends java.lang.Object
    A CRC32 calculator.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int crc
      The current CRC.
      private static int[] crc32Table
      A static CRC lookup table.
    • Constructor Summary

      Constructors 
      Constructor Description
      Crc32()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getCRC()  
      void updateCRC​(int value)
      Update the CRC with a single byte.
      void updateCRC​(int value, int count)
      Update the CRC with a sequence of identical bytes.
      • Methods inherited from class java.lang.Object

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

      • crc32Table

        private static final int[] crc32Table
        A static CRC lookup table.
      • crc

        private int crc
        The current CRC.
    • Constructor Detail

      • Crc32

        Crc32()
    • Method Detail

      • getCRC

        public int getCRC()
        Returns:
        The current CRC.
      • updateCRC

        public void updateCRC​(int value)
        Update the CRC with a single byte.
        Parameters:
        value - The value to update the CRC with
      • updateCRC

        public void updateCRC​(int value,
                              int count)
        Update the CRC with a sequence of identical bytes.
        Parameters:
        value - The value to update the CRC with
        count - The number of bytes