Here you can find the source of toHexString(int i)
public static String toHexString(int i)
//package com.java2s; //License from project: Open Source License public class Main { public static String toHexString(int i) { String hex = Integer.toHexString(i); if (hex.length() == 1) { return "0" + hex; } else {// w ww . java 2 s . co m return hex; } } }