List of utility methods to do Unsigned Int Create
int | toUnsignedInt(byte b) to Unsigned Int return (b >= 0) ? b : 256 + b;
|
int | toUnsignedInt(byte b) Convert a signed byte to an unsigned int (unsigned in the sense that only values between 0 and 255 are allowed). return b & 0xFF;
|
long | toUnsignedInt(byte b1, byte b2, byte b3, byte b4) to Unsigned Int return ((b1 & 0xFF) | ((b2 & 0xFF) << 8) | ((b3 & 0xFF) << 16) | ((b4 & 0xFF) << 24)) & 0xFFFFFFFFl;
|
int | toUnsignedInt(byte value) Transforms the given byte value to an positive int between 0 and 255. int intValue = value & 0x7F; return value < 0 ? intValue + 128 : intValue; |
int | toUnsignedInt(byte x) Converts the argument to an int by an unsigned conversion. return ((int) x) & 0xff; |
int[] | toUnsignedInt(byte[] a) this method copies a byte array to an int array and treats the byte values as unsigned int[] b = new int[a.length]; for (int i = 0; i < a.length; i++) { b[i] = a[i] & 0xff; return b; |
long | toUnsignedInt(char[] bytes, boolean le) to Unsigned Int if (bytes.length != 8) return 0; return Long.parseLong(bytesToString(bytes, le, false), 16); |
long | toUnsignedInt(int i) Converts an int to the corresponding unsigned int value and returns the result as a long return (long) (i & MAX_INT); |
int | toUnsignedInt(int value) to Unsigned Int return value & 0xFF;
|
long | toUnsignedInt(int value) to Unsigned Int if (value >= 0) { return value; } else { return ((long) value) >>> 32; |