Ishani shah Ishani shah - 6 months ago 63
Java Question

convert hex file into binary file

How to convert hex file into binary file. I want code in core Java. to convert hex file into binary file which would be taken by user from dialogue in android application.
Thanks

Answer

try this code:

String hexToBinary(String hex) {
int i = Integer.parseInt(hex, 16);
String bin = Integer.toBinaryString(i);
return bin;
}

otherwise check this link : Convert hexadecimal string (hex) to a binary string

Comments