Here you can find the source of byteToHex(byte[] bytes)
private static String byteToHex(byte[] bytes)
//package com.java2s; //License from project: Open Source License public class Main { private static String byteToHex(byte[] bytes) { String hex = ""; for (int i = 0; i < bytes.length; i++) { hex += Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1); }/*ww w. ja v a 2 s . com*/ return hex; } }