Class PureJavaCrc32C
- java.lang.Object
-
- org.apache.commons.compress.compressors.snappy.PureJavaCrc32C
-
- All Implemented Interfaces:
java.util.zip.Checksum
final class PureJavaCrc32C extends java.lang.Object implements java.util.zip.Checksum
A pure-java implementation of the CRC32 checksum that uses the CRC32-C polynomial, the same polynomial used by iSCSI and implemented on many Intel chipsets supporting SSE4.2.This file is a copy of the implementation at the Apache Hadoop project.
- Since:
- 1.7
- See Also:
- "https://svn.apache.org/repos/asf/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/PureJavaCrc32C.java"
-
-
Field Summary
Fields Modifier and Type Field Description private int
crc
the current CRC value, bit-flippedprivate static int[]
T
private static int
T8_0_START
private static int
T8_1_START
private static int
T8_2_START
private static int
T8_3_START
private static int
T8_4_START
private static int
T8_5_START
private static int
T8_6_START
private static int
T8_7_START
-
Constructor Summary
Constructors Constructor Description PureJavaCrc32C()
Create a new PureJavaCrc32 object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getValue()
void
reset()
void
update(byte[] b, int off, int len)
void
update(int b)
-
-
-
Field Detail
-
crc
private int crc
the current CRC value, bit-flipped
-
T8_0_START
private static final int T8_0_START
- See Also:
- Constant Field Values
-
T8_1_START
private static final int T8_1_START
- See Also:
- Constant Field Values
-
T8_2_START
private static final int T8_2_START
- See Also:
- Constant Field Values
-
T8_3_START
private static final int T8_3_START
- See Also:
- Constant Field Values
-
T8_4_START
private static final int T8_4_START
- See Also:
- Constant Field Values
-
T8_5_START
private static final int T8_5_START
- See Also:
- Constant Field Values
-
T8_6_START
private static final int T8_6_START
- See Also:
- Constant Field Values
-
T8_7_START
private static final int T8_7_START
- See Also:
- Constant Field Values
-
T
private static final int[] T
-
-
Method Detail
-
getValue
public long getValue()
- Specified by:
getValue
in interfacejava.util.zip.Checksum
-
reset
public void reset()
- Specified by:
reset
in interfacejava.util.zip.Checksum
-
update
public void update(byte[] b, int off, int len)
- Specified by:
update
in interfacejava.util.zip.Checksum
-
update
public final void update(int b)
- Specified by:
update
in interfacejava.util.zip.Checksum
-
-