public static String readerToString(final Reader fileReader) throws IOException {
  final StringBuilder sb=new StringBuilder();
  try (BufferedReader br=new BufferedReader(fileReader)){
    final char[] buffer=FileUtils.makeBuffer();
    final int eof=-1;
    for (int len=br.read(buffer); len > eof; len=br.read(buffer)) {
      for (int i=0; i < len; i++) {
        sb.append(buffer[i]);
      }
    }
  }
   return sb.toString();
}

public static String readerToString ( final Reader fileReader ) throws IOException { final StringBuilder sb = new StringBuilder ( ) ; try ( BufferedReader br = new BufferedReader ( fileReader ) ) { final char [ ] buffer = FileUtils . makeBuffer ( ) ; final int eof = - 1 ; for ( int len = br . read ( buffer ) ; len > eof ; len = br . read ( buffer ) ) { for ( int i = 0 ; i < len ; i ++ ) { sb . append ( buffer [ i ] ) ; } } } return sb . toString ( ) ; }
read the contents of a reader and turn it into a string .
