Class JdkSerializer
java.lang.Object
io.micronaut.core.serialize.JdkSerializer
- All Implemented Interfaces:
ObjectSerializer
@Deprecated(since="5.2",
forRemoval=true)
public final class JdkSerializer
extends Object
implements ObjectSerializer
Deprecated, for removal: This API element is subject to removal in a future version.
JDK serialization is insecure when deserializing data that can be influenced by an attacker.
Use a safer serialization format instead.
A
ObjectSerializer that uses JDK serialization.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from interface ObjectSerializer
JDK -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Default constructor.JdkSerializer(ConversionService conversionService) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescription<T> Optional<T> deserialize(@Nullable InputStream inputStream, Argument<T> requiredType) Deprecated, for removal: This API element is subject to removal in a future version.Deserialize the given object to bytes.<T> Optional<T> deserialize(@Nullable InputStream inputStream, Class<T> requiredType) Deprecated, for removal: This API element is subject to removal in a future version.Deserialize the given object to bytes.voidserialize(@Nullable Object object, OutputStream outputStream) Deprecated, for removal: This API element is subject to removal in a future version.Serialize the given object to a byte[].Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ObjectSerializer
deserialize, deserialize, deserialize, serialize
-
Constructor Details
-
JdkSerializer
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
conversionService- The conversion service
-
JdkSerializer
public JdkSerializer()Deprecated, for removal: This API element is subject to removal in a future version.Default constructor.
-
-
Method Details
-
serialize
public void serialize(@Nullable Object object, OutputStream outputStream) throws SerializationException Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ObjectSerializerSerialize the given object to a byte[].- Specified by:
serializein interfaceObjectSerializer- Parameters:
object- The object to serializeoutputStream- The output stream- Throws:
SerializationException- if there is a serialization problem
-
deserialize
public <T> Optional<T> deserialize(@Nullable InputStream inputStream, Class<T> requiredType) throws SerializationException Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ObjectSerializerDeserialize the given object to bytes.- Specified by:
deserializein interfaceObjectSerializer- Type Parameters:
T- The required generic type- Parameters:
inputStream- The input streamrequiredType- The required type- Returns:
- An
Optionalof the object - Throws:
SerializationException- if there is a serialization problem
-
deserialize
public <T> Optional<T> deserialize(@Nullable InputStream inputStream, Argument<T> requiredType) throws SerializationException Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:ObjectSerializerDeserialize the given object to bytes.- Specified by:
deserializein interfaceObjectSerializer- Type Parameters:
T- The required generic type- Parameters:
inputStream- The input streamrequiredType- The required type- Returns:
- An
Optionalof the object - Throws:
SerializationException- if there is a serialization problem
-