Java tutorial
//package com.java2s; public class Main { private static byte charToByte(char ch) { return ((ch >= '0') && (ch <= '9')) ? (byte) (ch - '0') : (byte) (Character.toUpperCase(ch) - 'A' + 10); } }