Here you can find the source of convertToHex(byte[] data)
private static String convertToHex(byte[] data) throws java.io.IOException
//package com.java2s; import android.util.Base64; public class Main { private static String convertToHex(byte[] data) throws java.io.IOException { StringBuffer sb = new StringBuffer(); String hex = null;// w w w. j a va2 s. co m hex = Base64 .encodeToString(data, 0, data.length, Base64.NO_PADDING); sb.append(hex); return sb.toString(); } }