public static String copyToString(Reader in) throws IOException {
  StringWriter out=new StringWriter();
  copy(in,out);
  return out.toString();
}

public static String copyToString ( Reader in ) throws IOException { StringWriter out = new StringWriter ( ) ; copy ( in , out ) ; return out . toString ( ) ; }
copy the contents of the given reader into a string . closes the reader when done .
