I am new to java. I receive the UDP data in byte array. Each elements of the byte array have the hexadecimal value. I need to convert each element to integer.
public int[] bytearray2intarray(byte[] barray)
{
int[] iarray = new int[barray.length];
int i = 0;
for (byte b : barray)
iarray[i++] = b & 0xff;
// "and" with 0xff since bytes are signed in java
return iarray;
}