1 23 package org.hammurapi; 24 25 import java.io.IOException ; 26 import java.io.Reader ; 27 import java.io.StringReader ; 28 import java.io.StringWriter ; 29 30 36 public abstract class BufferedReviewRequest extends ReviewRequestBase { 37 private String source; 38 private String name; 39 40 44 public BufferedReviewRequest(ClassLoader classLoader, Reader in, String name) throws IOException { 45 super(classLoader); 46 this.name=name; 47 StringWriter sw=new StringWriter (); 48 char[] buf=new char[4096]; 49 int l; 50 while ((l=in.read(buf))!=-1) { 51 sw.write(buf, 0, l); 52 } 53 in.close(); 54 sw.close(); 55 source=sw.toString(); 56 } 57 58 public Reader getSource() { 59 return new StringReader (source); 60 } 61 62 public String getName() { 63 return name; 64 } 65 } 66 | Popular Tags |