2006/unicorn/src/org/w3c/unicorn/request Request.java,1.6,1.7

Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/request
In directory hutz:/tmp/cvs-serv6302/src/org/w3c/unicorn/request

Modified Files:
	Request.java 
Log Message:
removed comments

Index: Request.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/request/Request.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Request.java	18 Sep 2009 15:00:23 -0000	1.6
+++ Request.java	21 Sep 2009 15:51:33 -0000	1.7
@@ -122,11 +122,6 @@
 		return null;
 	}
 
-	@Override
-	public String toString() {
-		return "Abstract class org.w3c.unicorn.request.Request, toString function must be overrided.";
-	}
-
 	public String getResponseType() {
 		return responseType;
 	}
@@ -135,26 +130,17 @@
 		this.responseType = responseType;
 	}
 
-	protected Response streamToResponse(InputStream is) throws Exception {
+	protected Response streamToResponse(InputStream is) throws IOException {
 		
 		InputStreamReader isr = new InputStreamReader(is, "UTF-8");
 		BufferedReader buf = new BufferedReader(isr);
 		StringBuilder build = new StringBuilder();
-		int c = buf.read();
-		while (c != -1) {
-			build.append((char) c);
-			c = buf.read();
-		} 
-		
-		/*StringBuilder builder = new StringBuilder();
-		InputStreamReader isr = new InputStreamReader(is, "UTF-8");
 		
-		char[] chararray = new char[8192];
-		int readLength = 0;
-	
-		while ((readLength = isr.read(chararray, 0, 8192)) > -1) {
-			builder.append(chararray, 0, readLength);
-		}*/
+		String s = buf.readLine();
+		while (s != null) {
+			build.append(s);
+			s = buf.readLine();
+		} 
 		
 		Response res = ResponseParserFactory.parse(build.toString(), this.getResponseType());
 		if(res != null)

Received on Monday, 21 September 2009 15:51:43 UTC