Package io.pravega.client.stream.impl
Class UTF8StringSerializer
- java.lang.Object
-
- io.pravega.client.stream.impl.UTF8StringSerializer
-
- All Implemented Interfaces:
Serializer<java.lang.String>
,java.io.Serializable
public class UTF8StringSerializer extends java.lang.Object implements Serializer<java.lang.String>, java.io.Serializable
An implementation ofSerializer
that converts UTF-8 strings. Note that this is incompatible withJavaSerializer
of String.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface io.pravega.client.stream.Serializer
MAX_EVENT_SIZE
-
-
Constructor Summary
Constructors Constructor Description UTF8StringSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
deserialize(java.nio.ByteBuffer serializedValue)
Deserializes the given ByteBuffer into an event.java.nio.ByteBuffer
serialize(java.lang.String value)
Serializes the given event.
-
-
-
Method Detail
-
serialize
public java.nio.ByteBuffer serialize(java.lang.String value)
Description copied from interface:Serializer
Serializes the given event.- Specified by:
serialize
in interfaceSerializer<java.lang.String>
- Parameters:
value
- The event to be serialized.- Returns:
- The serialized form of the event.
NOTE: buffers returned should not exceed
Serializer.MAX_EVENT_SIZE
.
-
deserialize
public java.lang.String deserialize(java.nio.ByteBuffer serializedValue)
Description copied from interface:Serializer
Deserializes the given ByteBuffer into an event.- Specified by:
deserialize
in interfaceSerializer<java.lang.String>
- Parameters:
serializedValue
- A event that has been previously serialized.- Returns:
- The event object.
-
-