Top Description Fields Constructors Methods
io.netty.handler.codec.compression

pack-priv Class Crc32c

extends ByteBufChecksum
Class Inheritance

Implements CRC32-C as defined in: "Optimization of Cyclic Redundancy-CHeck Codes with 24 and 32 Parity Bits", IEEE Transactions on Communications 41(6): 883-892 (1993). The implementation of this class has been sourced from the Appendix of RFC 3309, but with masking due to Java not being able to support unsigned types.

Field Summary

Modifier and TypeField and Description
private static final int
private int
private static final int[]
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static int
crc32c(int crc, int b)

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(int
the byte to update the checksum with
b
)

Implements java.util.zip.Checksum.update.

Updates the current checksum with the specified byte.
public void
update(byte[]
the byte array to update the checksum with
buffer
,
int
the start offset of the data
offset
,
int
the number of bytes to use for the update
length
)

Implements java.util.zip.Checksum.update.

Updates the current checksum with the specified array of bytes.
Inherited from io.netty.handler.codec.compression.ByteBufChecksum:
updatewrapChecksum

Field Detail

BYTE_MASKback to summary
private static final int BYTE_MASK
crcback to summary
private int crc
CRC_TABLEback to summary
private static final int[] CRC_TABLE
LONG_MASKback to summary
private static final long LONG_MASK

Constructor Detail

Crc32cback to summary
pack-priv Crc32c()

Method Detail

crc32cback to summary
private static int crc32c(int crc, int b)
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

Annotations
@Override
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.

Annotations
@Override
updateback to summary
public 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

Annotations
@Override
updateback to summary
public void update(byte[] buffer, int offset, int length)

Implements java.util.zip.Checksum.update.

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

Updates the current checksum with the specified array of bytes.

Parameters
buffer:byte[]

the byte array to update the checksum with

offset:int

the start offset of the data

length:int

the number of bytes to use for the update

Annotations
@Override