Byte Serializer Strategy
ByteSerializerStrategy is an implementation of the SerializerStrategy interface that uses byte streams for serialization and deserialization.
It provides methods to serialize and deserialize various data types, including primitive types, collections, and maps.
This strategy is used by default in the SerializerStrategy interface.
The serializing is defined as follows:
The first 4 bytes are the size of the data.
For each entry in the data:
The key is written as a UTF string.
The type of the value is written as a UTF string.
The value is written using the appropriate method based on its type.
For collections, the size is written first, followed by the type of the elements. Then for each element is starts by 1.1
For maps, the size is written first, followed by the type of the keys and values. Then for each entry is starts by 1.1
For other types, the value is written directly. With the corresponding DataOutput methode.
For deserialization, the process is like the for writing, instead of writing the data, it is read.
Author
Fantamomo
Since
1.0-SNAPSHOT
Functions
Deserializes data from the provided input stream into a SerializerData object.