class HexString {

    public static byte[] decodeHexString( String hexString )
    {
        int len = hexString.length();
        byte[] data = new byte[len / 2];
        for ( int i = 0, j = 0; i < len; i += 2, j++ )
        {
            int highByte = Character.digit( hexString.charAt( i ), 16 ) << 4;
            int lowByte = Character.digit( hexString.charAt( i + 1 ), 16 );
            if ( highByte < 0 || lowByte < 0 )
            {
                return null;
            }
            data[j] = (byte) ( highByte + lowByte );
        }
        return data;
    }

    private  HexString();

}