Here you can find the source of charToByte(char c)
private static byte charToByte(char c)
//package com.java2s; //License from project: Apache License public class Main { private static final char[] CHARS = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; private static byte charToByte(char c) { for (int i = 0; i < CHARS.length; i++) { if (c == CHARS[i]) { return (byte) i; }// w w w . j a va2 s .co m } return Byte.MIN_VALUE; } }