List of utility methods to do Integer to
byte | intToUByte(int i) int To U Byte if ((i > 255) || (i < 0)) throw new RuntimeException("can't convert " + i + " to an unsigned byte"); return (byte) i; |
long | intToULong(int signed) int To U Long if (signed < 0) { return ((long) signed) + (((long) Integer.MAX_VALUE) - ((long) Integer.MIN_VALUE) + 1); return signed; |
long | intToUnsigned(int signed) int To Unsigned if (signed >= 0) { return signed; } else { return (long) (4294967296L + (long) signed); |
byte | intToUnsignedByte(int i) int To Unsigned Byte return (byte) ((i <= 0x7F) ? i : i - 0x100); |
long | intToUnsignedInt(int data) int to unsigned int return data & 0xffffffffL;
|
long | intToUnsignedLong(int data) Converts the given integer value to an unsigned long number. return 0x00000000ffffffff & ((long) data); |
byte[] | intToUnsignedShort(int value) int To Unsigned Short byte[] ret = new byte[2]; ret[0] = (byte) ((value & 0xff00) >>> 8); ret[1] = (byte) (value & 0xff); return ret; |
String | intToWeb(int color) int To Web int b = (color) & 0xFF; int g = (color >> 8) & 0xFF; int r = (color >> 16) & 0xFF; return hex2d(Integer.toString(r, 16)) + hex2d(Integer.toString(g, 16)) + hex2d(Integer.toString(b, 16)); |
int | intToZigZag(final int n) int To Zig Zag return (n << 1) ^ (n >> 31);
|