Class StringSerializer
java.lang.Object
de.iip_ecosphere.platform.transport.serialization.StringSerializer
- All Implemented Interfaces:
InputTypeTranslator<byte[],,String> OutputTypeTranslator<String,,byte[]> Serializer<String>,TypeTranslator<String,byte[]>
A default serializer for String through Base64 encoding.
- Author:
- Holger Eichelberger, SSE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new value instance and copies the values fromoriginto the new instance.from(byte[] data) Deserializes a target value into a source value ("input from external").getType()The type to be handled by this serializer.byte[]Translates a source value into a target value ("output to external").
-
Constructor Details
-
StringSerializer
public StringSerializer()
-
-
Method Details
-
from
Description copied from interface:InputTypeTranslatorDeserializes a target value into a source value ("input from external").- Specified by:
fromin interfaceInputTypeTranslator<byte[],String> - Parameters:
data- the data to be translated back- Returns:
- the serialized object
- Throws:
IOException- in case that serialization fails
-
to
Description copied from interface:OutputTypeTranslatorTranslates a source value into a target value ("output to external").- Specified by:
toin interfaceOutputTypeTranslator<String,byte[]> - Parameters:
source- the source value to be translated- Returns:
- the target value
- Throws:
IOException- in case that translation fails
-
clone
Description copied from interface:SerializerCreates a new value instance and copies the values fromoriginto the new instance. Use theSerializerRegistryto implement cloning of nested object values.- Specified by:
clonein interfaceSerializer<String>- Parameters:
origin- the object to clone- Returns:
- the cloned object
- Throws:
IOException- in case that cloning/serialization operations fail
-
getType
Description copied from interface:SerializerThe type to be handled by this serializer.- Specified by:
getTypein interfaceSerializer<String>- Returns:
- the type
-