You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/03/01 18:24:14 UTC
[camel] 08/16: CAMEL-15562: offset should skip when converting to InputStream
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit e08ec3b33fef91c388cfdf77b527286b2909847c
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu Feb 24 09:00:41 2022 +0100
CAMEL-15562: offset should skip when converting to InputStream
---
.../java/org/apache/camel/component/file/GenericFileConverter.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileConverter.java b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileConverter.java
index 63c1edf..cffc53d 100644
--- a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileConverter.java
+++ b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileConverter.java
@@ -121,7 +121,10 @@ public final class GenericFileConverter {
} else {
LOG.debug("Read file {} (no charset)", f);
}
- return IOHelper.toInputStream(f, charset);
+ InputStream inputStream = IOHelper.toInputStream(f, charset);
+ inputStream.skip(file.getLastOffset().offset());
+
+ return inputStream;
}
}
if (exchange != null) {