List of utility methods to do Byte Array to Int Convert
int | getInt(byte[] bytes) get Int return (0xff & bytes[0]) | (0xff00 & (bytes[1] << 8))
| (0xff0000 & (bytes[2] << 16))
| (0xff000000 & (bytes[3] << 24));
|
int | getInt(int offset, byte[] fromBytes) get Int final int toInt; toInt = ((0xff & fromBytes[offset + 0]) << 24) | ((0xff & fromBytes[offset + 1]) << 16) | ((0xff & fromBytes[offset + 2]) << 8) | ((0xff & fromBytes[offset + 3]) << 0); return toInt; |
int | getInt2(byte[] b, int offset) get Int return ((b[offset] & 0xff) << 8) | (b[offset + 1] & 0xff);
|
int | getInt3(byte[] b, int offset) get Int return ((b[offset] & 0xff) << 16) | ((b[offset + 1] & 0xff) << 8)
| (b[offset + 2] & 0xff);
|
int | getIntFrom2ByteArray(final byte[] input) get Int From Byte Array final byte[] result = new byte[4]; result[0] = 0; result[1] = 0; result[2] = input[0]; result[3] = input[1]; return getIntFromByteArray(result); |
int | getIntFromByte(final byte bite) get Int From Byte return Integer.valueOf(bite & 0xFF);
|
int | getIntFromByte(final byte bite) Converts a byte to an int, preserving the sign. return Integer.valueOf(bite & 0xFF);
|
int | getIntFromByteArray(final byte[] byteArr) get Int From Byte Array return ByteBuffer.wrap(byteArr).getInt();
|
int | getIntFromByteArray(final byte[] bytes) Converts a byte array to an int. return ByteBuffer.wrap(bytes).getInt();
|
int | getIntLE2(byte[] b, int offset) get Int LE return ((b[offset + 1] & 0xff) << 8) | (b[offset] & 0xff);
|