Here you can find the source of FormatAs4CharHexa(int nValue)
static public String FormatAs4CharHexa(int nValue)
//package com.java2s; /*/*ww w. java 2 s. c om*/ * JLib - Publicitas Java library v1.2.0. * * Copyright (c) 2005, 2006, 2007, 2008, 2009 Publicitas SA. * Licensed under LGPL (LGPL-LICENSE.txt) license. */ public class Main { static public String FormatAs4CharHexa(int nValue) { String cs = ""; char c; for (int n = 0; n < 4; n++) { int nChar = nValue % 16; nValue = nValue / 16; if (nChar <= 9) c = (char) ('0' + nChar); else c = (char) ('A' + nChar - 10); cs = c + cs; } return cs; } }