Here you can find the source of checkSum(byte value)
public static byte checkSum(byte value)
//package com.java2s; //License from project: Open Source License public class Main { public static byte checkSum(byte value) { return (byte) (value ^ (-1)); }// w w w .java2 s. c om public static byte[] checkSum(byte[] data) { if (null == data) { throw new IllegalArgumentException("data should not be null"); } byte[] checkSum = new byte[data.length]; for (int i = 0; i < data.length; i++) { checkSum[i] = checkSum(data[i]); } return checkSum; } }