public interface Serializer
Modifier and Type | Method and Description |
---|---|
<T> T |
copy(T object)
Copies the specified object.
|
<T> T |
decode(byte[] bytes)
Deserialize the specified bytes.
|
<T> byte[] |
encode(T object)
Serialize the specified object.
|
static Serializer |
forTypes(Class<?>... classes) |
static Serializer |
using(KryoNamespace kryo)
Creates a new Serializer instance from a KryoNamespace.
|
static Serializer |
using(KryoNamespace namespace,
Class<?>... classes)
Creates a new Serializer instance from a KryoNamespace and some additional classes.
|
static Serializer |
using(List<KryoNamespace> namespaces,
Class<?>... classes)
Creates a new Serializer instance from a list of KryoNamespaces and some additional classes.
|
<T> byte[] encode(T object)
T
- encoded typeobject
- object to serialize.<T> T decode(byte[] bytes)
T
- decoded typebytes
- byte array to deserialize.<T> T copy(T object)
T
- object typeobject
- object to copy.static Serializer using(KryoNamespace kryo)
kryo
- kryo namespacestatic Serializer using(KryoNamespace namespace, Class<?>... classes)
namespace
- kryo namespaceclasses
- variable length array of classes to registerstatic Serializer using(List<KryoNamespace> namespaces, Class<?>... classes)
namespaces
- kryo namespacesclasses
- variable length array of classes to registerstatic Serializer forTypes(Class<?>... classes)