Here you can find the source of crcBytes(byte[]... data)
Parameter | Description |
---|---|
data | 0 or more arrays for the crc |
public static long crcBytes(byte[]... data)
//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(); } }