public static int find(byte[] a,int fromIndex,int toIndex,byte key){
  int result=-1;
  if (fromIndex < 0) {
    fromIndex=0;
  }
  toIndex=Math.min(toIndex,a.length);
  for (int i=fromIndex; fromIndex < toIndex && result == -1 && i < toIndex; i++) {
    if (a[i] == key) {
      result=i;
    }
  }
  return result;
}

public static int find ( byte [ ] a , int fromIndex , int toIndex , byte key ) { int result = - 1 ; if ( fromIndex < 0 ) { fromIndex = 0 ; } toIndex = Math . min ( toIndex , a . length ) ; for ( int i = fromIndex ; fromIndex < toIndex && result == - 1 && i < toIndex ; i ++ ) { if ( a [ i ] == key ) { result = i ; } } return result ; }
retrieve a byte from a byte array .
