Ok. I now recall having this issue in an earlier project. Use the stream.Can... -methods to see what you can do with it, if you cant do what you want, wrap it in another stream. This method we used to be able to read a an incomming stream from whatever (as far as we needed) it came.
/// <summary> /// This method ensures that the stream is seekable so that it can be written to archive. /// </summary> /// <param name="stream">The stream to ensure is seekable.</param> public static Stream EnsureSeekableStream(Stream stream) { if (!stream.CanSeek) { stream = new Microsoft.BizTalk.Streaming.ReadOnlySeekableStream(stream); } return stream; }
//Niklas