Package org.apache.shiro.lang.io
Class XmlSerializer
java.lang.Object
org.apache.shiro.lang.io.XmlSerializer
- All Implemented Interfaces:
Serializer
Deprecated.
This class should not be used directly because of unsecure XMLEncoder/XMLDecoder usage.
Serializer implementation that uses the JavaBeans
XMLEncoder and XMLDecoder to 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 -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(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[]Deprecated.Serializes the specifiedsourceinto a byte[] array by using theXMLEncoderto encode the object out to aByteArrayOutputStream, where the resulting byte[] array is returned.
-
Constructor Details
-
XmlSerializer
public XmlSerializer()Deprecated.
-
-
Method Details
-
serialize
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
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.
-