Here you can find the source of toHex(int myByte)
private static char toHex(int myByte)
//package com.java2s; //it under the terms of the GNU General Public License as published by public class Main { private static final String HEX_DIGITS = "0123456789ABCDEF"; private static char toHex(int myByte) { return HEX_DIGITS.charAt(myByte & 0xF); }// www . j av a2 s . c om }