public class JdkSerializer extends java.lang.Object implements ObjectSerializer
ObjectSerializer that uses JDK serialization.JDK| Constructor and Description |
|---|
JdkSerializer()
Default constructor.
|
JdkSerializer(ConversionService<?> conversionService) |
| Modifier and Type | Method and Description |
|---|---|
protected java.io.ObjectInputStream |
createObjectInput(java.io.InputStream inputStream,
java.lang.Class<?> requiredType) |
protected java.io.ObjectOutputStream |
createObjectOutput(java.io.OutputStream outputStream) |
<T> java.util.Optional<T> |
deserialize(java.io.InputStream inputStream,
Argument<T> requiredType)
Deserialize the given object to bytes.
|
<T> java.util.Optional<T> |
deserialize(java.io.InputStream inputStream,
java.lang.Class<T> requiredType)
Deserialize the given object to bytes.
|
void |
serialize(java.lang.Object object,
java.io.OutputStream outputStream)
Serialize the given object to a byte[].
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeserialize, deserialize, deserialize, serializepublic JdkSerializer(ConversionService<?> conversionService)
conversionService - The conversion servicepublic JdkSerializer()
public void serialize(java.lang.Object object,
java.io.OutputStream outputStream)
throws SerializationException
ObjectSerializerserialize in interface ObjectSerializerobject - The object to serializeoutputStream - The output streamSerializationException - if there is a serialization problempublic <T> java.util.Optional<T> deserialize(java.io.InputStream inputStream,
java.lang.Class<T> requiredType)
throws SerializationException
ObjectSerializerdeserialize in interface ObjectSerializerT - The required generic typeinputStream - The input streamrequiredType - The required typeOptional of the objectSerializationException - if there is a serialization problempublic <T> java.util.Optional<T> deserialize(java.io.InputStream inputStream,
Argument<T> requiredType)
throws SerializationException
ObjectSerializerdeserialize in interface ObjectSerializerT - The required generic typeinputStream - The input streamrequiredType - The required typeOptional of the objectSerializationException - if there is a serialization problemprotected java.io.ObjectOutputStream createObjectOutput(java.io.OutputStream outputStream)
throws java.io.IOException
outputStream - The output streamObjectOutputStreamjava.io.IOException - if there is an errorprotected java.io.ObjectInputStream createObjectInput(java.io.InputStream inputStream,
java.lang.Class<?> requiredType)
throws java.io.IOException
inputStream - The input streamrequiredType - The required typeObjectOutputStreamjava.io.IOException - if there is an error