public static String read(Reader aReader){
  StringBuffer sb=new StringBuffer();
  try {
    BufferedReader bReader=new BufferedReader(aReader);
    char[] data=new char[2048];
    int count=0;
    while ((count=bReader.read(data)) != -1) {
      sb.append(data,0,count);
    }
    bReader.close();
    aReader.close();
  }
 catch (  IOException e) {
  }
  return sb.toString();
}

public static String read ( Reader aReader ) { StringBuffer sb = new StringBuffer ( ) ; try { BufferedReader bReader = new BufferedReader ( aReader ) ; char [ ] data = new char [ 2048 ] ; int count = 0 ; while ( ( count = bReader . read ( data ) ) != - 1 ) { sb . append ( data , 0 , count ) ; } bReader . close ( ) ; aReader . close ( ) ; } catch ( IOException e ) { } return sb . toString ( ) ; }
returns resource string from a reader .
