private static int hexDigitToDec(char c)
    {
        for (int i = 0; i < hexNums.length; i++)
        {
            if (hexNums[i] == c)
            {
                return i;
            }
        }
        System.err.println("invalid character \"" + c + "\"");
        return -1;
    }