Here you can find the source of toHex(int nybble)
public static char toHex(int nybble)
//package com.java2s; //License from project: Open Source License public class Main { public static char toHex(int nybble) { if (nybble < 0 || nybble > 15) { throw new IllegalArgumentException(); }// ww w . j a v a 2s. c o m return "0123456789ABCDEF".toLowerCase().charAt(nybble); } }