Here you can find the source of toHex(byte lowByte)
public static char toHex(byte lowByte)
//package com.java2s; //License from project: Open Source License public class Main { public static char toHex(byte lowByte) { assert (lowByte < 16); if (lowByte < 10) { return (char) ('0' + lowByte); } else if (lowByte < 16) { return (char) ('A' + lowByte - 10); } else {/*from ww w. ja va 2 s. com*/ return '?'; } } }