Hello,
A stream is a buffer, and when you read, you move the pointer along the stream until the end. To use the same stream again, you will have to rewind the pointer to the beginning of the stream. java.io.ByteArrayInputStream seams to such the mark, read, and reset methods to allow you to reuse a stream. You will have to handle those operations in a separate service. You can pass in the stream to a mark service, then do your normal reading. When you are done, you can pass it into a reset service. Streams are for ease on memory and Strings are for ease of manipulation (relatively). Good day.
Yemi Bedu
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB