Hello,
I have a HexString as below:
String xx = "A101FF3A2D";
now I want to convert this string into byte array. Perhaps if I can write something like:
byte[] b = new byte[xx.length()/2];
b[0]=0xA1;
b[1]=0x01;
b[2]=0xFF;
b[3]=0x3A;
b[4]=0x2D;
But I am confused how to write a program here as extracting 2 characters from the string xx and adding up 0x again make it string and I could not understand how to add this in byte array.
Though i have written following methods to achieve same but seems not satisfied and
would like to know if there could be a better approach? regards,
Arun