Here you can find the source of toHex(byte one)
private static String toHex(byte one)
//package com.java2s; //License from project: Open Source License public class Main { private static String toHex(byte one) { String HEX = "0123456789ABCDEF"; char[] result = new char[2]; result[0] = HEX.charAt((one & 0xf0) >> 4); result[1] = HEX.charAt(one & 0x0f); return new String(result); }// w w w . j a v a 2 s . com }