writeOutput(writer2);
} else {
//check whether we have a MTOMXMLStreamWriter. if so
//we can optimize the writing!
if (writer2 instanceof MTOMXMLStreamWriter) {
MTOMXMLStreamWriter writer = (MTOMXMLStreamWriter) writer2;
if (writer.isOptimized()) {
if (contentID == null) {
contentID = writer.getNextContentId();
}
// send binary as MTOM optimised
this.attribute = new OMAttributeImpl("href",
new OMNamespaceImpl("", ""),
"cid:" + getContentID(), this.factory);
this.serializeStartpart(writer);
writer.writeOptimized(this);
writer.writeEndElement();
} else {
//do normal base64
writeOutput(writer);
}
} else {