Oliver,

It kind of depends on what you are trying to do with the stream.

If you can do your transformation in a streaming fasion, that's the ideal 
scenario.   An example is gzipping the stream.  You can just wrapper the 
original stream with a gzip stream and the "write" methods on the new stream 
handle everything.

If you need access to the entire message (like as a byte[] or similar) for 
your transform, you need a way to obtain the whole message.   That's where 
the caching streams come in.    The caching streams cache everything that is 
written to them, first in a  byte[] and then into a temp file once a 
threshold is crossed.    They then let you manipulate the temp file/byte[] as 
need before you then write it into the original stream.   

It really depends on your needs and how your transformation works.   If it can 
be implemented in a streaming manner, the performance it much better and 
memory usage is lower and such, but a lot of things cannot be implemented 
that way.

Dan




On Friday 26 September 2008 9:02:32 am Wulff, Oliver wrote:
> Hi there
>
> I've to develop an interceptor where I want to do some transformations on
> the stream before the soap message is sent and some transformations on the
> stream before the soap message is parsed on the server side.
>
> I had a look to the sample StreamInterceptor.java in the demo
> configuration_interceptor. I don't understand the implemention. Could you
> give some background information for it?
>
> - What is the value of the class CachedOutputStream?
> - What is the need to implement the class CachedStream?
> - What is the need to run
> "message.getInterceptorChain().doIntercept(message);"?
>
>
> Thanks a lot for clarification
> Oliver



-- 
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to