Removed an unused method and an unused source jar.

This commit is contained in:
akwizgran
2013-06-19 14:08:43 +01:00
parent 3e0c16b59a
commit b2e7f9f3b6
2 changed files with 0 additions and 18 deletions

View File

@@ -62,22 +62,4 @@ public class ByteUtils {
assert result < 1 << bits;
return result;
}
/**
* Compares two byte arrays and returns -1, 0, or +1 if the first array is
* less than, equal to, or greater than the second array, respectively.
* <p>
* If one of the arrays is a prefix of the other, the longer array is
* considered to be greater. Bytes are treated as unsigned.
*/
public static int compare(byte[] b1, byte[] b2) {
for(int i = 0; i < b1.length || i < b2.length; i++) {
if(i == b1.length) return -1;
if(i == b2.length) return 1;
int b1i = b1[i] & 0xff, b2i = b2[i] & 0xff;
if(b1i < b2i) return -1;
if(b1i > b2i) return 1;
}
return 0;
}
}