public static String slurpReader(Reader reader){
  BufferedReader r=new BufferedReader(reader);
  StringBuffer buff=new StringBuffer();
  try {
    char[] chars=new char[SLURPBUFFSIZE];
    while (true) {
      int amountRead=r.read(chars,0,SLURPBUFFSIZE);
      if (amountRead < 0) {
        break;
      }
      buff.append(chars,0,amountRead);
    }
    r.close();
  }
 catch (  Exception e) {
    throw new RuntimeException();
  }
  return buff.toString();
}

public static String slurpReader ( Reader reader ) { BufferedReader r = new BufferedReader ( reader ) ; StringBuffer buff = new StringBuffer ( ) ; try { char [ ] chars = new char [ SLURPBUFFSIZE ] ; while ( true ) { int amountRead = r . read ( chars , 0 , SLURPBUFFSIZE ) ; if ( amountRead < 0 ) { break ; } buff . append ( chars , 0 , amountRead ) ; } r . close ( ) ; } catch ( Exception e ) { throw new RuntimeException ( ) ; } return buff . toString ( ) ; }
returns all the text from the given reader .
