Here you can find the source of fromHex(char c)
public static int fromHex(char c)
//package com.java2s; //License from project: Open Source License public class Main { public static int fromHex(char c) { if (c >= '0' && c <= '9') { return c - '0'; }//from ww w . j a va 2 s. c om if (c >= 'A' && c <= 'F') { return c - 'A' + 10; } if (c >= 'a' && c <= 'f') { return c - 'a' + 10; } throw new IllegalArgumentException(); } }