How to extract byte-array from one xml and store it in another in Java

Posted by grobartn on Stack Overflow See other posts from Stack Overflow or by grobartn
Published on 2012-07-11T14:15:51Z Indexed on 2012/07/11 15:15 UTC
Read the original article Hit count: 206

Filed under:
|
|
|
|

So I am using DocumentBuilderFactory and DocumentBuilder to parse an xml. So it is DOM parser.

But what I am trying to do is extract byte-array data (its an image encoded in base64)

Store it in one object and later in code write it out to another xml encoded in base64.

What is the best way to store this in btw. Store it as string? or as ByteArray?

How can I extract byte array data in best way and write it out.

I am not experienced with this so wanted to get opinion from the group.

UPDATE: I am given XML I do not have control of incoming XML that comes in binary64 encoded

< byte-array >
  ... base64 encoded image ...
< /byte-array >

Using parser I have I need to store this node and question is should that be byte or string and then writing it out to another node in new xml. again in base64 encoding.

thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about Xml