I need to convert the binary string to a hex string but i have a problem. I converted the binary string to a hex string by this method:
public static String binaryToHex(String bin){ return Long.toHexString(Long.parseLong(bin,2)); } it's ok! but I lose the zeros to the left of the string. Ex:
the method return this: 123456789ABCDEF, but i want returned this:
00000123456789ABCDEF
String.formatmethod to append theStringwith0's