public int compareTo ( ByteArrayPair a ) { final int key_compare = Bytes . memcmpMaybeNull ( this . key , a . key ) ; if ( key_compare == 0 ) { return Bytes . memcmpMaybeNull ( this . value , a . value ) ; } return key_compare ; }
Sorts on the key first then on the value . Nulls are allowed and are ordered first .