public static int indexOf(float[] array,float[] sub,int startIndex,int endIndex){
  int sublen=sub.length;
  if (sublen == 0) {
    return startIndex;
  }
  int total=endIndex - sublen + 1;
  float c=sub[0];
  mainloop:   for (int i=startIndex; i < total; i++) {
    if (Float.compare(array[i],c) != 0) {
      continue;
    }
    int j=1;
    int k=i + 1;
    while (j < sublen) {
      if (Float.compare(sub[j],array[k]) != 0) {
        continue mainloop;
      }
      j++;
      k++;
    }
    return i;
  }
  return -1;
}

public static int indexOf ( float [ ] array , float [ ] sub , int startIndex , int endIndex ) { int sublen = sub . length ; if ( sublen == 0 ) { return startIndex ; } int total = endIndex - sublen + 1 ; float c = sub [ 0 ] ; mainloop : for ( int i = startIndex ; i < total ; i ++ ) { if ( Float . compare ( array [ i ] , c ) != 0 ) { continue ; } int j = 1 ; int k = i + 1 ; while ( j < sublen ) { if ( Float . compare ( sub [ j ] , array [ k ] ) != 0 ) { continue mainloop ; } j ++ ; k ++ ; } return i ; } return - 1 ; }
finds the first occurrence in an array from specified given position and upto given length .
