List of utility methods to do Integer From
int | IntFromRGB(int r, int g, int b) Int From RGB return r * 256 * 256 + g * 256 + b;
|
int | intFromString(String str, int dflt) Convert a string into an integer. try { Integer val = Integer.valueOf(str); return val.intValue(); } catch (NumberFormatException nfe) { return dflt; |
int | intFromSyncSafeByteArray(byte[] buf, int offset, int len) utility to generate an int from an array of bytes in syncsafe format. int val = 0; int v2 = 0; for (int i = 0; i < len; i++) { val = val << 7; v2 = v2 << 7; int d = (char) (0x0000007F & buf[i + offset]); int d2 = buf[i + offset]; if (d2 < 0) ... |
int | intFromUnsignedByte(byte b) int From Unsigned Byte return (b < 0 ? b + 256 : b);
|