Class FastCrc


  • public final class FastCrc
    extends Object
    This CRC calculation implementation workf much faster then PureJavaCrc32
    • Constructor Detail

      • FastCrc

        public FastCrc()
    • Method Detail

      • reset

        public void reset()
        Preparation for further calculations.
      • getValue

        public int getValue()
        Returns:
        crc value.
      • update

        public void update​(ByteBuffer buf,
                           int len)
        Parameters:
        buf - Input buffer.
        len - Data length.
      • calcCrc

        public static int calcCrc​(ByteBuffer buf,
                                  int len)
        Parameters:
        buf - Input buffer.
        len - Data length.
        Returns:
        Crc checksum.
      • calcCrc

        public static int calcCrc​(File file)
                           throws IOException
        Parameters:
        file - A file to calculate checksum over it.
        Returns:
        CRC32 checksum.
        Throws:
        IOException - If fails.