class HexConverter {

    public static byte[] convertFromHex(final char[] toConvert) {
        if (toConvert.length % 2 != 0) {
            throw new IllegalArgumentException("The supplied character array must contain an even number of hex chars.");
        }

        byte[] response = new byte[toConvert.length / 2];

        for (int i = 0; i < response.length; i++) {
            int posOne = i * 2;
            response[i] = (byte) (toByte(toConvert, posOne) << 4 | toByte(toConvert, posOne + 1));
        }

        return response;
    }

}