Java tutorial
//package com.java2s; public class Main { public static String unsignedIntToHexString(int b) { String hex = Integer.toHexString(b); for (int i = 0; i < 2 - hex.length(); i++) { hex = "0" + hex; } return hex; } }