Binary to hexadecimal conversion with java
public static int binaryToHexadecimal(String binary) {
        // Declaring Hexadecimal variable
        String hex = "";
/**
 * Converting the Binary value to Hexadecimal Equivalent
 * First convert the Binary to Decimal Equivalent
 * Then to Hexadecimal Equivalent
 */
        // Converting Binary to decimal
        int number = Integer.parseInt( binary, 2 );
        // Converting Decimal Equivalent to Hexadecimal
        hex = Integer.toHexString( number );
        // Returning the Hexadecimal value
        return hex;
    }