compare


Description:

public int compare (Bytes bytes2)

Compares the two Bytes values.

This function can be used to sort GBytes instances in lexicographical order.

If this and bytes2 have different length but the shorter one is a prefix of the longer one then the shorter one is considered to be less than the longer one. Otherwise the first byte where both differ is used for comparison. If this has a smaller value at that position it is considered less, otherwise greater than bytes2.

Parameters:

this

a pointer to a Bytes

bytes2

a pointer to a Bytes to compare with this

Returns:

a negative value if this is less than bytes2, a positive value if this is greater than bytes2, and zero if this is equal to bytes2