public int compare(RandomAccessData o1,RandomAccessData o2,int startOffset){
  if (o1 == o2) {
    return 0;
  }
  if (o1 == POSITIVE_INFINITY) {
    return 1;
  }
  if (o2 == POSITIVE_INFINITY) {
    return -1;
  }
  int minBytesLen=Math.min(o1.size,o2.size);
  for (int i=startOffset; i < minBytesLen; i++) {
    int b1=o1.buffer[i] & 0xFF;
    int b2=o2.buffer[i] & 0xFF;
    if (b1 == b2) {
      continue;
    }
    return b1 - b2;
  }
  return o1.size - o2.size;
}

public int compare ( RandomAccessData o1 , RandomAccessData o2 , int startOffset ) { if ( o1 == o2 ) { return 0 ; } if ( o1 == POSITIVE_INFINITY ) { return 1 ; } if ( o2 == POSITIVE_INFINITY ) { return - 1 ; } int minBytesLen = Math . min ( o1 . size , o2 . size ) ; for ( int i = startOffset ; i < minBytesLen ; i ++ ) { int b1 = o1 . buffer [ i ] & 0xFF ; int b2 = o2 . buffer [ i ] & 0xFF ; if ( b1 == b2 ) { continue ; } return b1 - b2 ; } return o1 . size - o2 . size ; }
compare the two sets of bytes starting at the given offset .
