Here you can find the source of convertCharToByte(char firstChar, char secondChar)
public static byte convertCharToByte(char firstChar, char secondChar)
//package com.java2s; public class Main { public static byte convertCharToByte(char firstChar, char secondChar) { byte firstValue = (byte) convertCharToInt(firstChar); byte secondValue = (byte) convertCharToInt(secondChar); return (byte) ((byte) (firstValue << 4) | (byte) secondValue); }//from w w w . ja v a2 s . co m public static int convertCharToInt(char input) { if ((int) input >= (int) 'A') { return ((int) input - (int) 'A' + 10); } else { return ((int) input - (int) '0'); } } }