public int commonPrefixLength(RandomAccessData o1,RandomAccessData o2){
  int minBytesLen=Math.min(o1.size,o2.size);
  for (int i=0; i < minBytesLen; i++) {
    int b1=o1.buffer[i] & 0xFF;
    int b2=o2.buffer[i] & 0xFF;
    if (b1 != b2) {
      return i;
    }
  }
  return minBytesLen;
}

public int commonPrefixLength ( RandomAccessData o1 , RandomAccessData o2 ) { int minBytesLen = Math . min ( o1 . size , o2 . size ) ; for ( int i = 0 ; i < minBytesLen ; i ++ ) { int b1 = o1 . buffer [ i ] & 0xFF ; int b2 = o2 . buffer [ i ] & 0xFF ; if ( b1 != b2 ) { return i ; } } return minBytesLen ; }
compute the length of the common prefix of the two provided sets of bytes .
