camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r769434 - /camel/trunk/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
Date Tue, 28 Apr 2009 15:29:51 GMT
Author: davsclaus
Date: Tue Apr 28 15:29:49 2009
New Revision: 769434

URL: http://svn.apache.org/viewvc?rev=769434&view=rev
Log:
CAMEL-1568: Fixed bad patch not reading the entire stream.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java?rev=769434&r1=769433&r2=769434&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java Tue Apr
28 15:29:49 2009
@@ -209,9 +209,13 @@
         StringBuilder sb = new StringBuilder(1024);
         char[] buf = new char[1024];
         try {
-            int len = reader.read(buf);
-            if (len != -1) {
-                sb.append(buf, 0, len);
+            int len = 0;
+            // read until we reach then end which is the -1 marker
+            while (len != -1) {
+                len = reader.read(buf);
+                if (len != -1) {
+                    sb.append(buf, 0, len);
+                }
             }
         } finally {
             ObjectHelper.close(reader, "reader", LOG);



Mime
View raw message