Here you can find the source of byteArrayToHexString(byte[] b)
public static String byteArrayToHexString(byte[] b)
//package com.java2s; public class Main { public static String byteArrayToHexString(byte[] b) { String result = ""; for (int i = 0; i < b.length; i++) { result += Integer.toString((b[i] & 0xff) + 0x100, 16) .substring(1);/* www . j a va2s .co m*/ } return result; } }