Here you can find the source of asciiValue(byte b)
public static int asciiValue(byte b)
//package com.java2s; //License from project: Apache License public class Main { public static int asciiValue(byte b) { if ((b >= '0') && (b <= '9')) { return (b - '0'); }//from w ww . j av a 2 s. co m if ((b >= 'a') && (b <= 'f')) { return (b - 'a') + 0x0a; } if ((b >= 'A') && (b <= 'F')) { return (b - 'A') + 0x0a; } try { throw new Exception(); } catch (Exception ex) { } return -1; } }