Here you can find the source of toHexChar(int b)
public static char toHexChar(int b)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { public static char toHexChar(int b) { return (char) (b < 10 ? ('0' + b) : ('A' + b - 10)); }//from w ww.ja va 2 s .co m }