List of utility methods to do Byte to Int Convert
int | getInt(byte b1, byte b2) Gets an int from two bytes int i1 = b1 & 0xff; int i2 = b2 & 0xff; int val = i2 << 8 | i1; return val; |
int | getInt(byte b1, byte b2, byte b3, byte b4) Gets an int from four bytes, doing all the necessary swapping int i1 = getInt(b1, b2); int i2 = getInt(b3, b4); int val = i2 << 16 | i1; return val; |
int | makeInt(byte b3, byte b2, byte b1, byte b0) make Int return (int) ((((b3 & 0xff) << 24) | ((b2 & 0xff) << 16) | ((b1 & 0xff) << 8) | ((b0 & 0xff) << 0))); |