Package io.pravega.client.stream.impl
Class JavaSerializer<T extends java.io.Serializable>
- java.lang.Object
-
- io.pravega.client.stream.impl.JavaSerializer<T>
-
- All Implemented Interfaces:
Serializer<T>,java.io.Serializable
public class JavaSerializer<T extends java.io.Serializable> extends java.lang.Object implements Serializer<T>, java.io.Serializable
An implementation ofSerializerthat uses Java serialization.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface io.pravega.client.stream.Serializer
MAX_EVENT_SIZE
-
-
Constructor Summary
Constructors Constructor Description JavaSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)Tdeserialize(java.nio.ByteBuffer serializedValue)Deserializes the given ByteBuffer into an event.booleanequals(java.lang.Object o)inthashCode()java.nio.ByteBufferserialize(T value)Serializes the given event.
-
-
-
Method Detail
-
serialize
public java.nio.ByteBuffer serialize(T value)
Description copied from interface:SerializerSerializes the given event.- Specified by:
serializein interfaceSerializer<T extends java.io.Serializable>- 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 T deserialize(java.nio.ByteBuffer serializedValue)
Description copied from interface:SerializerDeserializes the given ByteBuffer into an event.- Specified by:
deserializein interfaceSerializer<T extends java.io.Serializable>- Parameters:
serializedValue- A event that has been previously serialized.- Returns:
- The event object.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-