Here you can find the source of int2hex(int i)
public static String int2hex(int i)
//package com.java2s; public class Main { public static String int2hex(int i) { String h = ""; h = Integer.toHexString(i); if (h.length() == 1) { h = "0" + h; }/*from w ww.jav a 2s .c o m*/ return h; } }