Here you can find the source of toHexValue(int number)
public static String toHexValue(int number)
//package com.java2s; /* //from w ww . ja v a 2 s . com * SMART FP7 - Search engine for MultimediA enviRonment generated contenT * Webpage: http://smartfp7.eu * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * The Original Code is Copyright (c) 2012-2013 the University of Glasgow * All Rights Reserved * * Contributor(s): * Dyaa Albakour <dyaa.albakour@glasgow.ac.uk> */ public class Main { public static String toHexValue(int number) { StringBuilder builder = new StringBuilder(Integer.toHexString(number & 0xff)); while (builder.length() < 2) { builder.append("0"); } return builder.toString().toUpperCase(); } }