I'm not seeing a way to use the OpenEXI API to hand data to JaXB's unmarshaller (javax.xml.bind.Unmarshaller) without first decoding the binary data to an XML string via the transmogrifier. It seems that it'd be much more efficient to hand Jaxb an XMLStreamReader that decodes the EXI-formatted binary data on-the-fly.
What am I missing? Is this doable via the OpenEXI API? Will you please supply some sample code to demonstrate this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Initially I was getting an EOFException due to having ported a ByteArrayOutputStream's contents to a ByteArrayInputStream via a toString() method which is a bad idea.
Here's the code that appears to do what I'm looking for:
I'm not seeing a way to use the OpenEXI API to hand data to JaXB's unmarshaller (javax.xml.bind.Unmarshaller) without first decoding the binary data to an XML string via the transmogrifier. It seems that it'd be much more efficient to hand Jaxb an XMLStreamReader that decodes the EXI-formatted binary data on-the-fly.
What am I missing? Is this doable via the OpenEXI API? Will you please supply some sample code to demonstrate this?
I think I've figured it out.
Initially I was getting an EOFException due to having ported a ByteArrayOutputStream's contents to a ByteArrayInputStream via a toString() method which is a bad idea.
Here's the code that appears to do what I'm looking for:
I'm attaching the whole method to give future readers the full context.
Last edit: Gordon 2014-03-19