I've based my extended Flat File Disassembler on the example http://www.codeproject.com/Articles/17140/Debatching-Large-Messages-and-Extending-Flatfile-P That uses a MemoryStream to pass on the disassembled data.
msg.Context = ibmParam.Context;
IBaseMessagePart msgPart = pCxt.GetMessageFactory().CreateMessagePart();
System.IO.MemoryStream memStrm = new MemoryStream();
xDoc.Save(memStrm);
memStrm.Position = 0;
memStrm.Seek(0, System.IO.SeekOrigin.Begin);
msgPart.Data = memStrm;
msg.AddPart(ibmParam.BodyPartName, msgPart, true);
outboundMessages.Add(msg);
pCxt.ResourceTracker.AddResource(memStrm);
This works...
However, due to the amount of data I need to process, using the above, I run out of memory. So I'm planning to replace the MemoryStream with a FileStream.
Question.
In the example above, the MemoryStream is created but not closed. So does the FF Disassembler expect the msgPart.Data to be an open IOStream? Or, when I change to a FileStream, should I call Flush() and Close()?
Thanks