protected static int compareStrings ( int offset_1 , byte [ ] key , ByteBuffer bb ) { offset_1 += bb . getInt ( offset_1 ) ; int len_1 = bb . getInt ( offset_1 ) ; int len_2 = key . length ; int startPos_1 = offset_1 + Constants . SIZEOF_INT ; int len = Math . min ( len_1 , len_2 ) ; for ( int i = 0 ; i < len ; i ++ ) { if ( bb . get ( i + startPos_1 ) != key [ i ] ) return bb . get ( i + startPos_1 ) - key [ i ] ; } return len_1 - len_2 ; }
Compare string from the buffer with the String object .