Write binary data using XMLStreamWriterEx( stax-ex-api)

hamppyncpype

New Member
The documentation says that XMLStreamWriter should be downcast to XMLStreamWriterEx to implement.But it throws ClassCastException.There is no example of how one should implement it.I tried doing the following and as expected ,ClassCastException was thrown.\[code\]XMLStreamWriter xmlStreamWriter = xmlFactory.createXMLStreamWriter(outFile);XMLStreamWriterEx xmlStreamWriterEx = (XMLStreamWriterEx) xmlStreamWriter;if(xmlStreamWriter instanceof XMLStreamWriterEx){ System.out.println("Voila!");}\[/code\]Is there any other way or API that i can use to write binary data using xmlstreamwriter?
 
Back
Top