Package io.pravega.client.stream.impl
Class ByteArraySerializer
- java.lang.Object
-
- io.pravega.client.stream.impl.ByteArraySerializer
-
- All Implemented Interfaces:
Serializer<byte[]>,java.io.Serializable
public class ByteArraySerializer extends java.lang.Object implements Serializer<byte[]>, java.io.Serializable
An implementation ofSerializerthat converts byte arrays.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface io.pravega.client.stream.Serializer
MAX_EVENT_SIZE
-
-
Constructor Summary
Constructors Constructor Description ByteArraySerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]deserialize(java.nio.ByteBuffer serializedValue)Deserializes the given ByteBuffer into an event.java.nio.ByteBufferserialize(byte[] value)Serializes the given event.
-
-
-
Method Detail
-
serialize
public java.nio.ByteBuffer serialize(byte[] value)
Description copied from interface:SerializerSerializes the given event.- Specified by:
serializein interfaceSerializer<byte[]>- 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 byte[] deserialize(java.nio.ByteBuffer serializedValue)
Description copied from interface:SerializerDeserializes the given ByteBuffer into an event.- Specified by:
deserializein interfaceSerializer<byte[]>- Parameters:
serializedValue- A event that has been previously serialized.- Returns:
- The event object.
-
-