JAXB maps both xsd:base64Binary
and xsd:hexBinary
types to byte[]
.
Given that I have a schema/a DOM Element representing each of these types such as:
<foo>ABCD</foo>
for xsd:hexBinary and
<foo>YTM0NZomIzI2OTsmIzM0NTueYQ==</foo>
for xsd:base64Binary ,
it's not clear how JAXB 2.1 handles it.
JAXB.unmarshal(new DOMSource(node), byte[].class)
does not like the payload.
Neither does the following:
JAXBContext ctx = JAXBContext.newInstance(byte[].class);
ctx.createUnmarshaller().unmarshal(node);
What's the correct way of handling these types? Thanks in advance.