public class ArrayOfUtf16StringsSerDe extends ArrayOfItemsSerDe<String>
ArrayOfStringsSerDe.
In an extreme case when all strings are in ASCII, the size is doubled. However it takes
less time to serialize and deserialize by a factor of 1.5 to 2.| Constructor and Description |
|---|
ArrayOfUtf16StringsSerDe() |
| Modifier and Type | Method and Description |
|---|---|
String[] |
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.
|
String[] |
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.
|
Class<String> |
getClassOfT()
Returns the concrete class of type T
|
byte[] |
serializeToByteArray(String item)
Serialize a single unserialized item to a byte array.
|
byte[] |
serializeToByteArray(String[] items)
Serialize an array of unserialized items to a byte array of contiguous serialized items.
|
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.
|
int |
sizeOf(String item)
Returns the serialized size in bytes of a single unserialized item.
|
String |
toString(String item)
Returns a human readable string of an item.
|
sizeOfpublic byte[] serializeToByteArray(String item)
ArrayOfItemsSerDeserializeToByteArray in class ArrayOfItemsSerDe<String>item - the item to be serializedpublic byte[] serializeToByteArray(String[] items)
ArrayOfItemsSerDeserializeToByteArray in class ArrayOfItemsSerDe<String>items - array of items to be serializedpublic String[] deserializeFromMemory(org.apache.datasketches.memory.Memory mem, int numItems)
ArrayOfItemsSerDedeserializeFromMemory in class ArrayOfItemsSerDe<String>mem - Memory containing a contiguous sequence of serialized itemsnumItems - number of items in the contiguous serialized sequence.ArrayOfItemsSerDe.deserializeFromMemory(Memory, long, int)public String[] deserializeFromMemory(org.apache.datasketches.memory.Memory mem, long offsetBytes, int numItems)
ArrayOfItemsSerDedeserializeFromMemory in class ArrayOfItemsSerDe<String>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 int sizeOf(String item)
ArrayOfItemsSerDesizeOf in class ArrayOfItemsSerDe<String>item - a specific itempublic int sizeOf(org.apache.datasketches.memory.Memory mem,
long offsetBytes,
int numItems)
ArrayOfItemsSerDesizeOf in class ArrayOfItemsSerDe<String>mem - the given Memory.offsetBytes - the starting offset in the given Memory.numItems - the number of serialized items contained in the Memorypublic String toString(String item)
ArrayOfItemsSerDetoString in class ArrayOfItemsSerDe<String>item - a specific itempublic Class<String> getClassOfT()
ArrayOfItemsSerDegetClassOfT in class ArrayOfItemsSerDe<String>Copyright © 2015–2024 The Apache Software Foundation. All rights reserved.