This will give the same result, however there are certain cases where using signum for comparisons fails, so it is best to stick with Integer.compare even if it is not a specific problem in this case.
While we're in here, we can also use Byte.toUnsignedInt for further code clarity in these cases.
This will give the same result, however there are certain cases where using
signum
for comparisons fails, so it is best to stick withInteger.compare
even if it is not a specific problem in this case.While we're in here, we can also use
Byte.toUnsignedInt
for further code clarity in these cases.