Java Utililty Methods Unsigned Number Create

List of utility methods to do Unsigned Number Create

Description

The list of methods to do Unsigned Number Create are organized into topic(s).

Method

intunsignedIntersect2by2(final short[] set1, final int length1, final short[] set2, final int length2, final short[] buffer)
Intersect two sorted lists and write the result to the provided output array
if (set1.length * 64 < set2.length) {
    return unsignedOneSidedGallopingIntersect2by2(set1, length1, set2, length2, buffer);
} else if (set2.length * 64 < set1.length) {
    return unsignedOneSidedGallopingIntersect2by2(set2, length2, set1, length1, buffer);
} else {
    return unsignedLocalIntersect2by2(set1, length1, set2, length2, buffer);
booleanunsignedIntersects(short[] set1, int length1, short[] set2, int length2)
Checks if two arrays intersect
if ((0 == length1) || (0 == length2)) {
    return false;
int k1 = 0;
int k2 = 0;
short s1 = set1[k1];
short s2 = set2[k2];
mainwhile: while (true) {
...
byte[]unsignedIntToByteArray(long value)
unsigned Int To Byte Array
return new byte[] { (byte) (value >>> 24), (byte) (value >>> 16), (byte) (value >>> 8), (byte) value };
charunsignedIntToHex(int i)
unsigned Int To Hex
if (i >= 0 && i <= 9) {
    return (char) (i + 48);
} else if (i >= 10 && i <= 15) {
    return (char) (i + 87);
} else {
    throw new IllegalArgumentException("Invalid hex int: out of range");
intunsignedIntToInt(byte[] b)
Convert a byte array to an unsigned int value
int i = 0;
i |= b[0] & 0xFF;
i <<= 8;
i |= b[1] & 0xFF;
i <<= 8;
i |= b[2] & 0xFF;
i <<= 8;
i |= b[3] & 0xFF;
...
longunsignedIntToLong(byte[] b)
Converts a 4 byte array of unsigned bytes to an long
long l = 0;
l |= b[0] & 0xFF;
l <<= 8;
l |= b[1] & 0xFF;
l <<= 8;
l |= b[2] & 0xFF;
l <<= 8;
l |= b[3] & 0xFF;
...
longunsignedIntToLong(byte[] b)
unsigned Int To Long
long l = 0;
l |= b[0] & 0xFF;
l <<= 8;
l |= b[1] & 0xFF;
l <<= 8;
l |= b[2] & 0xFF;
l <<= 8;
l |= b[3] & 0xFF;
...
longunsignedIntToLong(byte[] bytes)
unsigned Int To Long
long b1 = bytes[0] & 0xff;
long b2 = bytes[1] & 0xff;
long b3 = bytes[2] & 0xff;
long b4 = bytes[3] & 0xff;
return (long) ((b1 << 24) | (b2 << 16) | (b3 << 8) | (b4));
longunsignedIntToLong(byte[] source)
unsigned Int To Long
return ((long) ((0x000000FF & source[0]) << 24 | ((0x000000FF & source[1]) << 16)
        | ((0x000000FF & source[2]) << 8) | (0x000000FF & source[3])) & 0xFFFFFFFFL);
LongunsignedIntToLong(int value)
Converts an int which is being treated as unsigned to a long
return value & 0xffffffffL;