T
- The type of the object being serialized and deserialized.public interface Serializer<T>
Serializer
converts objects to raw binary data and vice versa, enabling persistent storage
of objects to files, HTTP cookies, or other mechanism.
A Serializer
should only do conversion, never change the data, such as encoding/decoding or
encryption. These orthogonal concerns are handled elsewhere by Shiro, for example, via
CodecSupport
and CipherService
s.Modifier and Type | Method and Description |
---|---|
T |
deserialize(byte[] serialized)
Converts the specified raw byte[] array back into an original Object form.
|
byte[] |
serialize(T o)
Converts the specified Object into a byte[] array.
|
byte[] serialize(T o) throws SerializationException
deserialize
method.o
- the Object to convert into a byte[] array.SerializationException
- if an error occurs converting the Object into a byte[] array.T deserialize(byte[] serialized) throws SerializationException
serialize
method call.serialized
- the raw data resulting from a previous serialize
call.SerializationException
- if an error occurs converting the raw byte[] array back into an Object.Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.