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

shortunsignedToSigned16(char value)
Converts the specified unsigned 16 bit value to a signed 16 bit value.
return (short) (value > Short.MAX_VALUE ? -(Character.MAX_VALUE - (value - 1)) : value);
shortunsignedToSigned8(char value)
Converts the specified unsigned 8 bit value to a signed 8 bit value.
char workvalue = (char) (value & 0xff);
return (short) (workvalue > Byte.MAX_VALUE ? -(255 - (workvalue - 1)) : workvalue);
intunsignedUnion2by2(final short[] set1, final int length1, final short[] set2, final int length2, final short[] buffer)
Unite two sorted lists and write the result to the provided output array
int pos = 0;
int k1 = 0, k2 = 0;
if (0 == length2) {
    System.arraycopy(set1, 0, buffer, 0, length1);
    return length1;
if (0 == length1) {
    System.arraycopy(set2, 0, buffer, 0, length2);
...
intunsignedUpcast(short s)
unsigned Upcast
return s & 0xFFFF;
intunsignedValue(byte signedByte)
unsigned Value
return signedByte & 0xff;
intunsignedVLQSize(int value)
unsigned VLQ Size
if (value < 1 << 7) {
    return 1;
if (value < 1 << 14) {
    return 2;
if (value < 1 << 21) {
    return 3;
...
StringunsignedZerofill(Integer number, int offset)
Converts an integer to a unsigned zerofill representation specified by the given offset.
String result = "";
while (result.length() < (offset - number.toString().length())) {
    result += "0";
return result + number.toString();
longunsignL(byte value)
Unsign the specified byte value and return it as long
return value & 0xFFL;