-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
area - serializationChanges pertaining to serialization of dataChanges pertaining to serialization of datafeatureNew feature or requestNew feature or request
Description
It might sometimes be useful to have a serializer that serializes an int to fewer than 4 bytes.
As an example, StringSerializer takes in an int serializer to serialize the length of the string, but the length of the string is quite unlikely to actually reach int.MaxValue bytes. You could save bytes by using an int serializer that ignores the most significant bytes. For many cases, 1 or 2 bytes would be sufficient.
I think it would be implemented as a single class TruncatingIntSerializer, which can take a parameter of the number of bytes to use to serialize the value, and if an incoming value to serialize is larger than can be stored in that number of bytes, it throws an exception
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area - serializationChanges pertaining to serialization of dataChanges pertaining to serialization of datafeatureNew feature or requestNew feature or request
Type
Projects
Status
Todo