com.echomine.xmlrpc
Class Base64Serializer

java.lang.Object
  extended by com.echomine.xmlrpc.Base64Serializer
All Implemented Interfaces:
Deserializer, Serializer

public class Base64Serializer
extends java.lang.Object
implements Serializer, Deserializer

Serializer for the base64 binary data Example:

 <base64>eW91IGNhbid0IHJlYWQgdGhpcyE=</base64>
 


Field Summary
static java.lang.String NAME
           
 
Constructor Summary
Base64Serializer()
           
 
Method Summary
 java.lang.Object deserialize(Element elem)
          Deserializes the data into a byte[] array object.
 Element serialize(java.lang.Object data, Namespace ns)
          Serializes the data into a base64 element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values
Constructor Detail

Base64Serializer

public Base64Serializer()
Method Detail

serialize

public Element serialize(java.lang.Object data,
                         Namespace ns)
Serializes the data into a base64 element. The object accepted must be a byte[] array.

Specified by:
serialize in interface Serializer
Parameters:
data - a byte[] array object
ns - optional namespace, null if none
Returns:
the element representing the data

deserialize

public java.lang.Object deserialize(Element elem)
Deserializes the data into a byte[] array object. If an error occurs while deserializing the base64 data, exception WILL NOT be thrown. However, null will be returned instead.

Specified by:
deserialize in interface Deserializer
Parameters:
elem - the data
Returns:
a byte[] array element containing the byte data, or null if the data cannot be decoded


Copyright © 2001-2005 Echomine. All Rights Reserved.