Package io.pravega.client.stream
Interface Serializer<T>
- 
- Type Parameters:
- T- The type of event that this serializes.
 - All Known Implementing Classes:
- WatermarkSerializer
 
 public interface Serializer<T>Takes events being written and serializes them to byteBuffers so they can be sent over the wire and deserializes these same byte buffers back into objects.NOTE: There is no need for implementations to implement any sort of "framing"; the byte buffers passed to deserialize will be of the appropriate length. 
- 
- 
Field SummaryFields Modifier and Type Field Description static intMAX_EVENT_SIZEThe maximum event size, in bytes.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description Tdeserialize(java.nio.ByteBuffer serializedValue)Deserializes the given ByteBuffer into an event.java.nio.ByteBufferserialize(T value)Serializes the given event.
 
- 
- 
- 
Field Detail- 
MAX_EVENT_SIZEstatic final int MAX_EVENT_SIZE The maximum event size, in bytes.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
serializejava.nio.ByteBuffer serialize(T value) Serializes the given event.- Parameters:
- value- The event to be serialized.
- Returns:
- The serialized form of the event.
 NOTE: buffers returned should not exceed MAX_EVENT_SIZE.
 
 - 
deserializeT deserialize(java.nio.ByteBuffer serializedValue) Deserializes the given ByteBuffer into an event.- Parameters:
- serializedValue- A event that has been previously serialized.
- Returns:
- The event object.
 
 
- 
 
-