Here you can find the source of binarySearch(byte[] a, byte key, int startPos)
public static int binarySearch(byte[] a, byte key, int startPos)
//package com.java2s; //License from project: Open Source License public class Main { public static int binarySearch(byte[] a, byte key, int startPos) { if (startPos > a.length || startPos < 0) { return -1; }/*from w w w . j ava2 s . c o m*/ for (int i = startPos; i < a.length; i++) { if (a[i] == key) { return i; } } return -1; } }