org.apache.ignite.internal.processors.cache.persistence.wal.crc

## Class PureJavaCrc32

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.wal.crc.PureJavaCrc32

    public class PureJavaCrc32
    extends Object

This class was taken from Hadoop org.apache.hadoop.util.PureJavaCrc32 A pure-java implementation of the CRC32 checksum that uses the same polynomial as the built-in native CRC32. This is to avoid the JNI overhead for certain uses of Checksumming where many small pieces of data are checksummed in succession. The current version is ~10x to 1.8x as fast as Sun's native java.util.zip.CRC32 in Java 1.6

### Constructor Summary

Constructors
Constructor and Description
`PureJavaCrc32()` Create a new PureJavaCrc32 object.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static int` `calcCrc32(ByteBuffer b, int len)` Calculates CRC32 checksum.
`int` `getValue()` return crc32 value
`void` `reset()` preparation for further calculations
`void` `update(ByteBuffer b, int len)`
`void` `update(int b)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PureJavaCrc32

    public PureJavaCrc32()

Create a new PureJavaCrc32 object.

### Method Detail

#### getValue

    public int getValue()

return crc32 value

#### reset

    public void reset()

preparation for further calculations

#### update

    public void update(ByteBuffer b,
                       int len)

Parameters:
  `b` - B.
  `len` - Length.

#### update

    public final void update(int b)

Parameters:
  `b` - B.

#### calcCrc32

    public static int calcCrc32(ByteBuffer b,
                                int len)

Calculates CRC32 checksum. This method will move buffer's position to `len` bytes forward.

Parameters:
  `b` - B.
  `len` - Length.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.4.0
Release Date | : March 5 2018