Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static String int2HaxString(int i) { String hex = Integer.toHexString(i); if (hex.length() == 1) { hex = "0" + hex; } return hex; } }