Package com.usatiuk.objects
Class JavaDataSerializer
java.lang.Object
com.usatiuk.objects.JavaDataSerializer
- All Implemented Interfaces:
ObjectSerializer<JData>
@ApplicationScoped
public class JavaDataSerializer
extends Object
implements ObjectSerializer<JData>
Simple Java object serializer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(ByteBuffer data) Deserialize an object from a ByteBuffer.com.google.protobuf.ByteString
Serialize an object to a ByteString.
-
Constructor Details
-
JavaDataSerializer
public JavaDataSerializer()
-
-
Method Details
-
serialize
Description copied from interface:ObjectSerializer
Serialize an object to a ByteString.- Specified by:
serialize
in interfaceObjectSerializer<JData>
- Parameters:
obj
- the object to serialize- Returns:
- the serialized object as a ByteString
-
deserialize
Description copied from interface:ObjectSerializer
Deserialize an object from a ByteBuffer.- Specified by:
deserialize
in interfaceObjectSerializer<JData>
- Parameters:
data
- the ByteBuffer containing the serialized object- Returns:
- the deserialized object
-