Here you can find the source of toHexChar(int i)
private static char toHexChar(int i)
//package com.java2s; public class Main { private static char toHexChar(int i) { if (i >> 4 != 0) throw new RuntimeException(); return (char) ((i < 10) ? i + '0' : i - 10 + 'a'); }/* ww w . j ava 2 s .co m*/ }