Here you can find the source of toHex(int ch)
private static char toHex(int ch)
//package com.java2s; //License from project: Open Source License public class Main { private static char toHex(int ch) { return (char) (ch < 10 ? '0' + ch : 'A' + ch - 10); }/*w w w . ja v a2 s . c o m*/ }