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