Hi Willem, thanks for the clarification. I thought one potential use case of this CachedOutputStream could be to allow the data to be read independently after cached. Have there not been any such use cases?
If these use cases are considered not important, that will be okay too. The background to my question was that I wanted to add a similar encryption option like in CXF to protect the files if there is no other means to protect them. Can I create a Jira with this suggestion? regards, aki 2013/2/2 Willem Jiang <willem.ji...@gmail.com>: > Hi Aki, > The stream is supposed to be read once. If you want to read it twice, you > need to call the reset method. In camel we have an intercepter which will > call the reset method before routing the exchange to the other endpoint if > you enable the stream cache feature. > > > 发自我的 iPhone > > 在 2013-2-2,上午5:49,Aki Yoshida <elak...@gmail.com> 写道: > >> Hi, >> When using Camel's CachedOutputStream, I thought I could get the >> StreamCache over its getStreamCache() or the InputStream over its >> getInputStream() multiple times and read the cached data independently >> from them. But by looking at the implementation, this seems to be not >> the case. >> >> Am I correct to see that you can only read the data once unless you >> call the reset() method of the obtained StreamCache (e.g., >> FileInputStreamCache) object to reload the file? In other words, only >> one can read the data multiple times from it by calling its reset() >> each time? >> >> I may have missed something here, so I would appreciate your answer. >> >> Thank you. >> >> Regards, aki