Here you can find the source of toHexString(byte[] value)
public static String toHexString(byte[] value)
//package com.java2s; //License from project: LGPL public class Main { public static String toHexString(byte[] value) { String newString = ""; for (int i = 0; i < value.length; i++) { byte b = value[i]; String str = Integer.toHexString(b); if (str.length() > 2) { str = str.substring(str.length() - 2); }//from w w w . j av a 2s . c o m if (str.length() < 2) { str = "0" + str; } newString += str; } return newString.toUpperCase(); } }