Top Description Fields Constructors Methods
org.xerial.snappy

public Class PureJavaCrc32C

extends Object
implements Checksum
Class Inheritance
All Implemented Interfaces
java.util.zip.Checksum
Imports
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.

Field Summary

Modifier and TypeField and Description
private int
crc

the current CRC value, bit-flipped

pack-priv static final int[]
pack-priv static final int[]
pack-priv static final int[]
pack-priv static final int[]
pack-priv static final int[]
pack-priv static final int[]
pack-priv static final int[]
pack-priv static final int[]

Constructor Summary

AccessConstructor and Description
public
PureJavaCrc32C()

Create a new PureJavaCrc32 object.

Method Summary

Modifier and TypeMethod and Description
public int
public long
getValue()

Implements java.util.zip.Checksum.getValue.

Returns the current checksum value.

public void
reset()

Implements java.util.zip.Checksum.reset.

Resets the checksum to its initial value.

public void
update(byte[]
the byte array to update the checksum with
b
,
int
the start offset of the data
off
,
int
the number of bytes to use for the update
len
)

Implements java.util.zip.Checksum.update.

Updates the current checksum with the specified array of bytes.

public final void
update(int
the byte to update the checksum with
b
)

Implements java.util.zip.Checksum.update.

Updates the current checksum with the specified byte.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

crcback to summary
private int crc

the current CRC value, bit-flipped

T8_0back to summary
pack-priv static final int[] T8_0
T8_1back to summary
pack-priv static final int[] T8_1
T8_2back to summary
pack-priv static final int[] T8_2
T8_3back to summary
pack-priv static final int[] T8_3
T8_4back to summary
pack-priv static final int[] T8_4
T8_5back to summary
pack-priv static final int[] T8_5
T8_6back to summary
pack-priv static final int[] T8_6
T8_7back to summary
pack-priv static final int[] T8_7

Constructor Detail

PureJavaCrc32Cback to summary
public PureJavaCrc32C()

Create a new PureJavaCrc32 object.

Method Detail

getIntegerValueback to summary
public int getIntegerValue()
getValueback to summary
public long getValue()

Implements java.util.zip.Checksum.getValue.

Doc from java.util.zip.Checksum.getValue.

Returns the current checksum value.

Returns:long

the current checksum value

resetback to summary
public void reset()

Implements java.util.zip.Checksum.reset.

Doc from java.util.zip.Checksum.reset.

Resets the checksum to its initial value.

updateback to summary
public void update(byte[] b, int off, int len)

Implements java.util.zip.Checksum.update.

Doc from java.util.zip.Checksum.update.

Updates the current checksum with the specified array of bytes.

Parameters
b:byte[]

the byte array to update the checksum with

off:int

the start offset of the data

len:int

the number of bytes to use for the update

updateback to summary
public final void update(int b)

Implements java.util.zip.Checksum.update.

Doc from java.util.zip.Checksum.update.

Updates the current checksum with the specified byte.

Parameters
b:int

the byte to update the checksum with