List of utility methods to do Byte Array to Int Convert
int | buildInt(byte first, byte second) build Int return (byte) ((second << 8) & 0xFF) + (first & 0xFF); |
int | extractInt(byte[] data, int offset) extract Int return (((data[offset + 0] & 0xff) << 0)
| ((data[offset + 1] & 0xff) << 8)
| ((data[offset + 2] & 0xff) << 16) | ((data[offset + 3] & 0xff) << 24));
|
int | ByteToInt(byte[] b) Byte To Int int targets = (b[0] & 0xff) | ((b[1] << 8) & 0xff00) | ((b[2] << 24) >>> 8) | (b[3] << 24); return targets; |
int | byteArray2Int(byte[] b) byte Array Int return (b[0] << 24) + ((b[1] & 0xFF) << 16) + ((b[2] & 0xFF) << 8)
+ (b[3] & 0xFF);
|
int | byteArray2Int1(byte[] b) byte Array Int return (b[0] & 0xFF);
|
int | byteArray2Int3(byte[] b) byte Array Int return ((b[0] & 0xFF) << 16) + ((b[1] & 0xFF) << 8) + (b[2] & 0xFF);
|
int | byte2Int(byte b) byte Int return (b & 0xFF);
|
Integer | byte2Integer(byte bin) byte Integer return (Integer) (bin & 0xFF);
|
Integer | byte2Integer(byte[] bin) byte Integer int mask = 0xff; int temp = 0; int n = 0; int size = bin.length; if (size <= 0) { return 0; if (size < 2 && size > 0) { ... |
int | byteArrayToInt(byte[] b) byte Array To Int return (b[0] << 24) + ((b[1] & 0xFF) << 16) + ((b[2] & 0xFF) << 8)
+ (b[3] & 0xFF);
|