public interface ObjectSerializer
Modifier and Type | Field and Description |
---|---|
static ObjectSerializer |
JDK
The default JDK serializer.
|
Modifier and Type | Method and Description |
---|---|
default java.util.Optional<java.lang.Object> |
deserialize(byte[] bytes)
Deserialize the given object to bytes.
|
default <T> java.util.Optional<T> |
deserialize(byte[] bytes,
Argument<T> requiredType)
Deserialize the given object to bytes.
|
default <T> java.util.Optional<T> |
deserialize(byte[] bytes,
java.lang.Class<T> requiredType)
Deserialize the given object to bytes.
|
default <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.
|
default java.util.Optional<byte[]> |
serialize(java.lang.Object object)
Serialize the given object to a byte[].
|
void |
serialize(java.lang.Object object,
java.io.OutputStream outputStream)
Serialize the given object to a byte[].
|
static final ObjectSerializer JDK
void serialize(@Nullable java.lang.Object object, java.io.OutputStream outputStream) throws SerializationException
object
- The object to serializeoutputStream
- The output streamSerializationException
- if there is a serialization problem<T> java.util.Optional<T> deserialize(@Nullable java.io.InputStream inputStream, java.lang.Class<T> requiredType) throws SerializationException
T
- The required generic typeinputStream
- The input streamrequiredType
- The required typeOptional
of the objectSerializationException
- if there is a serialization problemdefault <T> java.util.Optional<T> deserialize(@Nullable java.io.InputStream inputStream, Argument<T> requiredType) throws SerializationException
T
- The required generic typeinputStream
- The input streamrequiredType
- The required typeOptional
of the objectSerializationException
- if there is a serialization problemdefault java.util.Optional<byte[]> serialize(@Nullable java.lang.Object object) throws SerializationException
object
- The object to serializeSerializationException
- if there is a serialization problemdefault <T> java.util.Optional<T> deserialize(@Nullable byte[] bytes, java.lang.Class<T> requiredType) throws SerializationException
T
- The required generic typebytes
- The byte arrayrequiredType
- The required typeOptional
of the objectSerializationException
- if there is a serialization problemdefault <T> java.util.Optional<T> deserialize(@Nullable byte[] bytes, Argument<T> requiredType) throws SerializationException
T
- The required generic typebytes
- The byte arrayrequiredType
- The required typeOptional
of the objectSerializationException
- if there is a serialization problemdefault java.util.Optional<java.lang.Object> deserialize(@Nullable byte[] bytes) throws SerializationException
bytes
- The byte arrayOptional
of the objectSerializationException
- if there is a serialization problem