public static String convertReaderToString(Reader reader) throws IOException {
        final StringBuilder text = new StringBuilder();

        final char[] buf = new char[1024];
        int len = 0;

        while ( (len = reader.read( buf )) >= 0 ) {
            text.append( buf,
                         0,
                         len );
        }
        return text.toString();
    }
public static String convertReaderToString ( Reader reader ) throws IOException { final StringBuilder text = new StringBuilder ( ) ; final char [ ] buf = new char [ 1024 ] ; int len = 0 ; while ( ( len = reader . read ( buf ) ) >= 0 ) { text . append ( buf , 0 , len ) ; } return text . toString ( ) ; }
***********************************************************************
Converts the contents of the given Reader into a string.
WARNING: the given string is not reset (as not all
readers support reset). Consequently, anny further
attempt to read from the given reader will return nothing,
unless you reset the reader.
@param reader
@return he contents of the given Reader into a string.
@throws IOException
**********************************************************************