Convert first 4 bytes of a byte array to an int @param data The byte array @return An integer
(final byte data[])
| 19 | * @return An integer |
| 20 | */ |
| 21 | public static int byteToInt(final byte data[]) { |
| 22 | return (data[0] & 0xff) | |
| 23 | ((data[1] & 0xff) << 8) | |
| 24 | ((data[2] & 0xff) << 16) | |
| 25 | ((data[3] & 0xff) << 24); |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Convert an int to 4 bytes |
no outgoing calls
no test coverage detected