public void writeDataHandler(DataHandler dataHandler, String contentID, boolean optimize)
throws IOException, XMLStreamException {
finishStartElementIfNecessary();
Base64EncodingWriterOutputStream out = new Base64EncodingWriterOutputStream(new ContentHandlerWriter(contentHandler), 4096, true);
dataHandler.writeTo(out);
out.complete();
}
public void writeDataHandler(DataHandlerProvider dataHandlerProvider, String contentID,
boolean optimize) throws IOException, XMLStreamException {
writeDataHandler(dataHandlerProvider.getDataHandler(), contentID, optimize);