1 55 56 package org.apache.bsf.util; 57 58 import java.io.*; 59 60 66 public class IOUtils { 67 static boolean debug = false; 69 70 72 public static String getStringFromReader (Reader reader) throws IOException { 73 BufferedReader bufIn = new BufferedReader(reader); 74 StringWriter swOut = new StringWriter(); 75 PrintWriter pwOut = new PrintWriter(swOut); 76 String tempLine; 77 78 while ((tempLine = bufIn.readLine()) != null) { 79 pwOut.println(tempLine); 80 } 81 82 pwOut.flush(); 83 84 return swOut.toString(); 85 } 86 } 87 | Popular Tags |