Here you can find the source of IntToHexString(final int value)
public final static String IntToHexString(final int value)
//package com.java2s; //License from project: Creative Commons License public class Main { public final static String IntToHexString(final int value) { final String string = Integer.toString(value, 16).toUpperCase(); if (string.charAt(0) == '-') { return "-0X" + string.substring(1, string.length()); } else {/* w w w. j a v a 2s . com*/ return "0X" + string; } } }