Does XmlMtomReader store binary data from internal stream?

Actually, I would like to know if the XmlMtomReader reads the binary mime parts from the input stream directly? Or does it store them internally before I call the ReadContentAsBase64 () method?

+1


source to share


1 answer


As I recall (and it has been for a while ...), the XmlMtomReader requires a minimum amount of internal storage depending on the order in which the MIME parts appear in the input stream. (The MTOM standard allows them to appear in any order).

So if your input stream is like:

  • Binary part 1
  • Then the main body of XML like

<a / <b> ... binary 1 ... </b> <c> ... binary 2 ... </c> </d>



  • Then binary part 2

Here's what's going on:

  • To start reading the XML (element "a"), it must store the binary part 1 inside
  • When you read the content of element "b" it comes from internal storage
  • When you start reading the "c" element, it stores the rest of the XML inside (the "d" element) and advances the stream to binary 2. When you read the contents of the "c" element at this point, it comes directly from the stream, not from storage.
  • When you last read element "d", XML comes from internal storage
+1


source







All Articles