Here you can find the source of intToHex(int id)
private static String intToHex(int id)
//package com.java2s; //License from project: Apache License public class Main { private static String intToHex(int id) { if (id < 0x10) { return "0" + Integer.toHexString(id); } else {//w w w .j a va 2 s. c o m return Integer.toHexString(id); } } private static String intToHex(long _id) { int id = (int) _id; if (id < 0x10) { return "0" + Integer.toHexString(id); } else { return Integer.toHexString(id); } } }