Java CRC32 Byte Array crcBytes(byte[]... data)

Here you can find the source of crcBytes(byte[]... data)

Description

calculates the crc32 of all byte arrays

License

Open Source License

Parameter

Parameter Description
data 0 or more arrays for the crc

Return

the crc as a long (0x00000000XXXXXXXX)

Declaration

public static long crcBytes(byte[]... data) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.zip.CRC32;

public class Main {
    /**//w ww. j a  v a  2 s.co m
     * calculates the crc32 of all byte arrays
     * @param data 0 or more arrays for the crc
     * @return the crc as a long (0x00000000XXXXXXXX)
     */
    public static long crcBytes(byte[]... data) {
        CRC32 crc = new CRC32();
        for (int i = 0; i < data.length; i++) {
            crc.update(data[i]);
        }
        return crc.getValue();
    }
}

Related

  1. crc32(byte[] bytes)
  2. crc32(byte[] bytes)
  3. crc32(final byte[] bytes)
  4. crc32(String value)
  5. crc32Number(String s)
  6. createRandomCrc32Hex()
  7. getCRC()
  8. getCrc32(byte[] buf)
  9. getCRC32(String str)