Example usage for org.apache.hadoop.util PureJavaCrc32 update

List of usage examples for org.apache.hadoop.util PureJavaCrc32 update

Introduction

In this page you can find the example usage for org.apache.hadoop.util PureJavaCrc32 update.

Prototype

@Override
    public void update(final byte[] b, final int offset, final int len) 

Source Link

Usage

From source file:com.subspace.network.Util.java

License:Open Source License

public static int CRC32(byte[] data) {
    PureJavaCrc32 crc32Fast = new PureJavaCrc32();
    crc32Fast.update(data, 0, data.length);

    return (int) crc32Fast.getValue();
}