Package org.apache.shiro.io
Class XmlSerializer
- java.lang.Object
-
- org.apache.shiro.io.XmlSerializer
-
- All Implemented Interfaces:
Serializer
public class XmlSerializer extends Object implements Serializer
Deprecated.This class should not be used directly because of unsecure XMLEncoder/XMLDecoder usage.Serializer implementation that uses the JavaBeansXMLEncoderandXMLDecoderto serialize and deserialize, respectively. NOTE: The JavaBeans XMLEncoder/XMLDecoder only successfully encode/decode objects when they are JavaBeans compatible!- Since:
- 0.9
-
-
Constructor Summary
Constructors Constructor Description XmlSerializer()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Objectdeserialize(byte[] serialized)Deprecated.Deserializes the specifiedserializedsource back into an Object by using aByteArrayInputStreamto wrap the argument and then decode this stream via anXMLDecoder, where thereadObjectcall results in the original Object to return.byte[]serialize(Object source)Deprecated.Serializes the specifiedsourceinto a byte[] array by using theXMLEncoderto encode the object out to aByteArrayOutputStream, where the resulting byte[] array is returned.
-
-
-
Method Detail
-
serialize
public byte[] serialize(Object source)
Deprecated.Serializes the specifiedsourceinto a byte[] array by using theXMLEncoderto encode the object out to aByteArrayOutputStream, where the resulting byte[] array is returned.- Specified by:
serializein interfaceSerializer- Parameters:
source- the Object to convert into a byte[] array.- Returns:
- the byte[] array representation of the XML encoded output.
-
deserialize
public Object deserialize(byte[] serialized)
Deprecated.Deserializes the specifiedserializedsource back into an Object by using aByteArrayInputStreamto wrap the argument and then decode this stream via anXMLDecoder, where thereadObjectcall results in the original Object to return.- Specified by:
deserializein interfaceSerializer- Parameters:
serialized- the byte[] array representation of the XML encoded output.- Returns:
- the original source Object in reconstituted form.
-
-