Here you can find the source of fromHexDigit(int c)
private static int fromHexDigit(int c) throws NumberFormatException
//package com.java2s; //License from project: Apache License public class Main { private static int fromHexDigit(int c) throws NumberFormatException { if (c >= 0x30 && c < 0x3A) return c - 0x30; else if (c >= 0x41 && c < 0x47) return c - 0x37; else if (c >= 0x61 && c < 0x67) return c - 0x57; else//from ww w.j a v a2 s . c om throw new NumberFormatException('\'' + c + "' is not a valid hexadecimal digit."); } }