public class KryoSerializer extends Object implements Serializer
Commands by using the Kryo library.| Constructor and Description |
|---|
KryoSerializer() |
| Modifier and Type | Method and Description |
|---|---|
List<Command> |
deserialize(byte[] commands)
Deserializes
byte [] to SynchronizeFX Commands. |
<T> void |
registerSerializableClass(Class<T> clazz,
com.esotericsoftware.kryo.Serializer<T> serializer)
Registers a class that may be send over the network.
|
byte[] |
serialize(List<Command> commands)
Serializes SyncronizeFX
Commands to bytes. |
public <T> void registerSerializableClass(Class<T> clazz, com.esotericsoftware.kryo.Serializer<T> serializer)
serialize(List) or
deserialize(byte[]). If you invoke it after these methods it is not guaranteed that the
Kryo used by these methods will actually use your serializers.T - see clazz parameter.clazz - The class that's maybe send.serializer - An optional serializer for this class. If it's null than the default serialization of kryo
is used.public byte[] serialize(List<Command> commands)
Commands to bytes.
To deserialize them, use deserialize(byte[]). This method is thread safe.serialize in interface Serializercommands - The commands to serialize.public List<Command> deserialize(byte[] commands)
byte [] to SynchronizeFX Commands.
This method is thread save.deserialize in interface Serializercommands - The serialized form of SynchronizeFX Commands that was created by
serialize(List).Commands.Copyright © 2014 Saxonia Systems AG. All Rights Reserved.