Here you can find the source of countMSCandidates(byte[] byteARR)
public static void countMSCandidates(byte[] byteARR)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Collections; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Main { static Logger logger = LoggerFactory.getLogger("UTIL5"); public static void countMSCandidates(byte[] byteARR) { int candidateCountI = 0; int noHitCountI = 0; int byteNumI = 3; int toI = byteARR.length - byteNumI; ArrayList<Integer> tempAL = new ArrayList<Integer>(); for (int i = 0; i < toI; i += byteNumI) { for (int k = 0; k < 3; k++) { tempAL.add((int) byteARR[i + k] + 1); }/*from w w w . j a v a2 s .c o m*/ Collections.sort(tempAL); if ((tempAL.get(0) < tempAL.get(1)) && (tempAL.get(1) < (tempAL.get(2) - tempAL.get(0)))) { candidateCountI++; } else { noHitCountI++; } tempAL.clear(); } logger.info("candidate count is: " + candidateCountI + " / " + noHitCountI); } }