Package net.sodacan.core.serialize.kryo
Class KryoSerializer
java.lang.Object
net.sodacan.core.serialize.kryo.KryoSerializer
- All Implemented Interfaces:
Serializer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ActorId
protected ActorMetadata
protected KryoSerializerFactory
-
Constructor Summary
ConstructorsConstructorDescriptionKryoSerializer
(KryoSerializerFactory factory, ActorId actorId, ActorMetadata actorMetadata) -
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(byte[] source) Deserialize a byte array into a new Message.void
deserialize
(byte[] source, Actor actor) Deserialize the @Save fields of an Actor into an existing actor.deserializeField
(byte[] source, Class<?> fieldClass) Deserialize the @Save fields of an Actor into an existing actor.byte[]
Serialize the @Save fields of an Actorbyte[]
Serialize a Message to a byte arraybyte[]
serializeField
(Object fieldValue) Serialize a @Save field of an Actor
-
Field Details
-
factory
-
actorMetadata
-
actorId
-
-
Constructor Details
-
KryoSerializer
-
-
Method Details
-
serialize
Description copied from interface:Serializer
Serialize the @Save fields of an Actor- Specified by:
serialize
in interfaceSerializer
- Parameters:
actor
-- Returns:
-
deserialize
Description copied from interface:Serializer
Deserialize the @Save fields of an Actor into an existing actor.- Specified by:
deserialize
in interfaceSerializer
- Parameters:
source
-actor
-
-
serialize
Description copied from interface:Serializer
Serialize a Message to a byte array- Specified by:
serialize
in interfaceSerializer
- Parameters:
message
-- Returns:
-
deserialize
Description copied from interface:Serializer
Deserialize a byte array into a new Message.- Specified by:
deserialize
in interfaceSerializer
- Parameters:
source
-- Returns:
- A newly constructed Message
-
serializeField
Description copied from interface:Serializer
Serialize a @Save field of an Actor- Specified by:
serializeField
in interfaceSerializer
- Parameters:
fieldValue
-- Returns:
- Byte array
-
deserializeField
Description copied from interface:Serializer
Deserialize the @Save fields of an Actor into an existing actor.- Specified by:
deserializeField
in interfaceSerializer
- Parameters:
source
-fieldClass
- Class of the field that we're returning- Returns:
- An object containing the field value
-