Here you can find the source of binarySearch(byte[] readBuffer, int offset, int length, byte value)
public static int binarySearch(byte[] readBuffer, int offset, int length, byte value)
//package com.java2s; //License from project: Open Source License public class Main { public static int binarySearch(byte[] readBuffer, int offset, int length, byte value) { for (int i = offset; i < length; i++) { if (readBuffer[i] == value) return i; }//from www. j a v a2 s . c o m return -1; } }