Here you can find the source of sum(byte[] array, int offset, int size)
public static int sum(byte[] array, int offset, int size)
//package com.java2s; //License from project: Apache License public class Main { public static int sum(byte[] array, int offset, int size) { int sum = 0; for (int i = offset; i < offset + size; i++) sum ^= array[i];//w w w . j a v a 2 s. co m return sum; } }