I'm trying to convert my StringReader
back to a regular String
, as shown:
String string = reader.toString();
But when I try to read this string out, like this:
System.out.println("string: "+string);
All I get is a pointer value, like this:
java.io.StringReader@2c552c55
Am I doing something wrong in reading the string back?
import org.apache.commons.io.IOUtils;
String string = IOUtils.toString(reader);