For information on converting to InterSystems IRIS,
see the InterSystems IRIS Adoption Guide
and the InterSystems IRIS In-Place Conversion Guide,
both available on the WRC Distributions page (login required).
OutputToStream() sets output to be directed to a stream.
export is the exported stream.
If export is the oref of a stream, the MIME document will
be written to this existing stream at the current position.
If export is "", then a new %GlobalBinaryStream will be
created to contain the MIME document and its oref returned.
In this case, export must be passed by reference.