Here you can find the source of ToHex(byte[] src)
public static String ToHex(byte[] src)
//package com.java2s; //License from project: Open Source License public class Main { public static String ToHex(byte[] src) { String res = ""; for (int i = 0; i < src.length; i++) { res += String.format("%02X", src[i] & 0xFF); }// w w w. jav a 2s. c o m return res.toLowerCase(); } }