Here you can find the source of toByte(char c)
private static int toByte(char c)
//package com.java2s; //License from project: Open Source License public class Main { private static final String baseChar = "0123456789abcdef"; private static int toByte(char c) { byte b = (byte) baseChar.indexOf(c); return b; }//from w w w .j a v a 2 s . c om }