Here you can find the source of unsignedIntToHex(int i)
private static char unsignedIntToHex(int i)
//package com.java2s; //License from project: Open Source License public class Main { private static char unsignedIntToHex(int i) { if (i >= 0 && i <= 9) { return (char) (i + 48); } else if (i >= 10 && i <= 15) { return (char) (i + 87); } else {/* w w w . java 2 s. com*/ throw new IllegalArgumentException( "Invalid hex int: out of range"); } } }