public String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName) {
// inline the data based on the threshold
if (myMtomFeature.getThreshold() > length) {
return null; // JAXB inlines the attachment data
}
ByteArrayBuffer bab = new ByteArrayBuffer(new DataHandler(new ByteArrayDataSource(data, offset, length, mimeType)), boundary);
mtomAttachments.add(bab);
return "cid:"+bab.contentId;
}
@Override