• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package de.timroes.axmlrpc.serializer;
2 
3 import de.timroes.axmlrpc.XMLRPCException;
4 import de.timroes.axmlrpc.XMLUtil;
5 import de.timroes.axmlrpc.xmlcreator.XmlElement;
6 import de.timroes.base64.Base64;
7 import org.w3c.dom.Element;
8 
9 /**
10  *
11  * @author Tim Roes
12  */
13 public class Base64Serializer implements Serializer {
14 
deserialize(Element content)15 	public Object deserialize(Element content) throws XMLRPCException {
16 		return Base64.decode(XMLUtil.getOnlyTextContent(content.getChildNodes()));
17 	}
18 
serialize(Object object)19 	public XmlElement serialize(Object object) {
20 		return XMLUtil.makeXmlTag(SerializerHandler.TYPE_BASE64,
21 				Base64.encode((Byte[])object));
22 	}
23 
24 }