T - Type of itempublic abstract class ArrayOfItemsSerDe<T> extends Object
| Constructor and Description |
|---|
ArrayOfItemsSerDe() |
| Modifier and Type | Method and Description |
|---|---|
T[] |
deserializeFromMemory(org.apache.datasketches.memory.Memory mem,
int numItems)
Deserialize a contiguous sequence of serialized items from the given Memory
starting at a Memory offset of zero and extending numItems.
|
abstract T[] |
deserializeFromMemory(org.apache.datasketches.memory.Memory mem,
long offsetBytes,
int numItems)
Deserialize a contiguous sequence of serialized items from the given Memory
starting at the given Memory offsetBytes and extending numItems.
|
abstract Class<T> |
getClassOfT()
Returns the concrete class of type T
|
abstract byte[] |
serializeToByteArray(T item)
Serialize a single unserialized item to a byte array.
|
abstract byte[] |
serializeToByteArray(T[] items)
Serialize an array of unserialized items to a byte array of contiguous serialized items.
|
abstract int |
sizeOf(org.apache.datasketches.memory.Memory mem,
long offsetBytes,
int numItems)
Returns the serialized size in bytes of the number of contiguous serialized items in Memory.
|
abstract int |
sizeOf(T item)
Returns the serialized size in bytes of a single unserialized item.
|
int |
sizeOf(T[] items)
Returns the serialized size in bytes of the array of items.
|
abstract String |
toString(T item)
Returns a human readable string of an item.
|
public abstract byte[] serializeToByteArray(T item)
item - the item to be serializedpublic abstract byte[] serializeToByteArray(T[] items)
items - array of items to be serializedpublic T[] deserializeFromMemory(org.apache.datasketches.memory.Memory mem, int numItems)
mem - Memory containing a contiguous sequence of serialized itemsnumItems - number of items in the contiguous serialized sequence.deserializeFromMemory(Memory, long, int)public abstract T[] deserializeFromMemory(org.apache.datasketches.memory.Memory mem, long offsetBytes, int numItems)
mem - Memory containing a contiguous sequence of serialized itemsoffsetBytes - the starting offset in the given Memory.numItems - number of items in the contiguous serialized sequence.public abstract int sizeOf(T item)
item - a specific itempublic int sizeOf(T[] items)
items - an array of items.public abstract int sizeOf(org.apache.datasketches.memory.Memory mem,
long offsetBytes,
int numItems)
mem - the given Memory.offsetBytes - the starting offset in the given Memory.numItems - the number of serialized items contained in the Memorypublic abstract String toString(T item)
item - a specific itemCopyright © 2015–2024 The Apache Software Foundation. All rights reserved.