Class PureJavaCrc32C

java.lang.Object
org.apache.hadoop.util.PureJavaCrc32C
All Implemented Interfaces:
Checksum

@Public @Stable public class PureJavaCrc32C extends Object implements Checksum
The legacy PureJavaCrc32C implemented in HADOOP-7443 is much slower than JDK native implementation in modern JDKs, HADOOP-19839 rewrites it to delegate to JDK native CRC32C.
See Also:
  • Constructor Details

    • PureJavaCrc32C

      public PureJavaCrc32C()
  • Method Details

    • update

      public void update(int b)
      Specified by:
      update in interface Checksum
    • update

      public void update(byte[] b)
      Specified by:
      update in interface Checksum
    • update

      public void update(byte[] b, int off, int len)
      Specified by:
      update in interface Checksum
    • update

      public void update(ByteBuffer buffer)
      Specified by:
      update in interface Checksum
    • getValue

      public long getValue()
      Specified by:
      getValue in interface Checksum
    • reset

      public void reset()
      Specified by:
      reset in interface Checksum
    • mod

      public static int mod(long x)
      Compute x mod p, where p is the CRC32C polynomial.
      Parameters:
      x - the input value
      Returns:
      x mod p