Package org.apache.datasketches
Class ArrayOfItemsSerDe<T>
java.lang.Object
org.apache.datasketches.ArrayOfItemsSerDe<T>
- Type Parameters:
T- Type of item
- Direct Known Subclasses:
ArrayOfBooleansSerDe,ArrayOfDoublesSerDe,ArrayOfLongsSerDe,ArrayOfNumbersSerDe,ArrayOfStringsSerDe,ArrayOfUtf16StringsSerDe
public abstract class ArrayOfItemsSerDe<T> extends Object
Base class for serializing and deserializing custom types.
- Author:
- Alexander Saydakov
-
Constructor Summary
Constructors Constructor Description ArrayOfItemsSerDe() -
Method Summary
Modifier and Type Method Description abstract T[]deserializeFromMemory(org.apache.datasketches.memory.Memory mem, int numItems)Deserialize an array of items from a given Memory object.abstract byte[]serializeToByteArray(T[] items)Serialize an array of items to byte array.
-
Constructor Details
-
ArrayOfItemsSerDe
public ArrayOfItemsSerDe()
-
-
Method Details
-
serializeToByteArray
Serialize an array of items to byte array. The size of the array doesn't need to be serialized. This method is called by the sketch serialization process.- Parameters:
items- array of items to be serialized- Returns:
- serialized representation of the given array of items
-
deserializeFromMemory
Deserialize an array of items from a given Memory object. This method is called by the sketch deserialization process.- Parameters:
mem- Memory containing a serialized array of itemsnumItems- number of items in the serialized array- Returns:
- deserialized array of items
-