Convert hexadecimal string to IP Address
You can split your hex value in groups of 2 and then convert them to integers.
0A = 10
06 = 06
65 = 41
86 = 56
Code:
String hexValue = "0A064156";
String ip = "";
for(int i = 0; i < hexValue.length(); i = i + 2) {
ip = ip + Integer.valueOf(hexValue.subString(i, i+2), 16) + ".";
}
System.out.println("Ip = " + ip);
Output:
Ip = 10.6.65.86.
try this
InetAddress a = InetAddress.getByAddress(DatatypeConverter.parseHexBinary("0A064156"));
DatatypeConverter is from standard javax.xml.bind
package