Java Utililty Methods Binary to Hex

List of utility methods to do Binary to Hex

Description

The list of methods to do Binary to Hex are organized into topic(s).

Method

StringbinToHex(String bin)
bin To Hex
String result = "";
int decimal;
for (int i = 4; (i <= 64 && i <= bin.length()); i = i + 4) {
    decimal = Integer.parseInt(bin.substring((i - 4), i), 2);
    result = result.concat(Integer.toString(decimal, 16)).toUpperCase();
return result;
StringbinToHex(String sBinString)
bin To Hex
String sHexString = "";
String sTemp = "";
while (sBinString.length() >= 4) {
    sTemp = sBinString.substring(0, 4);
    sBinString = sBinString.substring(4, sBinString.length());
    sHexString += Integer.toHexString(Integer.parseInt(sTemp, 2));
if (sBinString.length() > 1) {
...
StringbinToHexString(byte[] bytes)
bin To Hex String
return new String(binToHex(bytes));