Title: [907] trunk/assembly/src/release/examples/http-binding/HttpClient.java: Better file-reading strategy
Revision
907
Author
gastaldi
Date
2005-11-23 12:58:23 -0500 (Wed, 23 Nov 2005)

Log Message

Better file-reading strategy

Modified Paths


Diff

Modified: trunk/assembly/src/release/examples/http-binding/HttpClient.java (906 => 907)

--- trunk/assembly/src/release/examples/http-binding/HttpClient.java	2005-11-23 17:16:26 UTC (rev 906)
+++ trunk/assembly/src/release/examples/http-binding/HttpClient.java	2005-11-23 17:58:23 UTC (rev 907)
@@ -33,9 +33,11 @@
 
         // Post the request file.
         FileInputStream fis = new FileInputStream("request.xml");
-        int c;
-        while ((c = fis.read()) >= 0) {
-            os.write(c);
+        
+        //Buffer
+        byte[] buf = new byte[256];
+        for (int c = fis.read(buf); c != -1; c = fis.read(buf)) {
+        	os.write(buf,0,c);
         }
         os.close();
         fis.close();

Reply via email to