Convert set of ascii characters back to string

Viewed 1974

I currently have a situation where I am converting string to ascii characters:

        String str = "are";  // or anything else

        StringBuilder sb = new StringBuilder();
        for (char c : str.toCharArray())
            sb.append((int)c);

        BigInteger mInt = new BigInteger(sb.toString());
        System.out.println(mInt);

where output (in this case) is 97114101 I am struggling to find a way how to reverse this, convert string of ascii characters back to a string e.g. "are"

5 Answers
Related