orpiske commented on a change in pull request #6270:
URL: https://github.com/apache/camel/pull/6270#discussion_r728679183



##########
File path: core/camel-util/src/main/java/org/apache/camel/util/IOHelper.java
##########
@@ -116,11 +118,22 @@ public static BufferedWriter buffered(Writer writer) {
     }
 
     public static String toString(Reader reader) throws IOException {
-        return toString(buffered(reader));
+        return toString(reader, INITIAL_OFFSET);
+    }
+
+    public static String toString(Reader reader, long offset) throws 
IOException {
+        return toString(buffered(reader), offset);
     }
 
     public static String toString(BufferedReader reader) throws IOException {
+        return toString(reader, INITIAL_OFFSET);
+    }
+
+    public static String toString(BufferedReader reader, long offset) throws 
IOException {
         StringBuilder sb = new StringBuilder(1024);
+
+        reader.skip(offset);

Review comment:
       In theory it's is fine, since the reader states that `n` must be equal 
or greater than 0. For 0 it should be no-op. I wanted to avoid the overhead or 
checking the offset twice as it's probably checked on reader anyway. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to