Class PureJavaCrc32


  • @Deprecated
    public class PureJavaCrc32
    extends Object
    Deprecated.
    Use FastCrc instead.
    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 Detail

      • PureJavaCrc32

        public PureJavaCrc32()
        Deprecated.
        Create a new PureJavaCrc32 object.
    • Method Detail

      • getValue

        public int getValue()
        Deprecated.
        return crc32 value
      • reset

        public void reset()
        Deprecated.
        preparation for further calculations
      • update

        public void update​(ByteBuffer b,
                           int len)
        Deprecated.
        Parameters:
        b - B.
        len - Length.
      • update

        public final void update​(int b)
        Deprecated.
        Parameters:
        b - B.
      • calcCrc32

        public static int calcCrc32​(ByteBuffer b,
                                    int len)
        Deprecated.
        Calculates CRC32 checksum. This method will move buffer's position to len bytes forward.
        Parameters:
        b - B.
        len - Length.