Java Utililty Methods Unsigned Short Create

List of utility methods to do Unsigned Short Create

Description

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

Method

inttoUnsignedShort(byte a, byte b)
Converts 2 bytes to a unsigned short.
int n;
n = (a & 0xff) << 8;
n |= (b & 0xff);
return n;
inttoUnsignedShort(byte b1, byte b2)
to Unsigned Short
return (b1 & 0xFF) | ((b2 & 0xFF) << 8);
inttoUnsignedShort(char[] bytes, boolean le)
to Unsigned Short
if (bytes.length != 4)
    return 0;
return (int) Long.parseLong(bytesToString(bytes, le, false), 16);
inttoUnsignedShort(int value)
to Unsigned Short
return SHORT_UNSIGNED_MASK & value;
inttoUnsignedShort(short s)
Converts a short to the corresponding unsigned short value and returns the result as an int
return (s & MAX_SHORT);
inttoUnsignedShort(short value)
Return the unsigned short value [0|65535] from the java short value [-32768|32767].
return value - Short.MIN_VALUE;