Closed dstelljes closed 2 years ago
Does it make sense to support native integer types for storage? For example, if a 32-bit system serialises an 'nint' then what type does a 64-bit system deserialise it as?
Avro encodes all integers as variable-length, so the encoding would be identical. The library has always been pretty lax about what types to map to integral schemas:
Integers are zig-zag encoded, so they take up as much space as they need. For that reason, Chr.Avro imposes no constraints on which numeric types can be serialized or deserialized to
"int"
or"long"
—if a conversion exists, the binary serializer and deserializer will use it.
That makes sense.. I saw the open bug on serialising long values which ties it all together.
Released in 8.0.0-rc.0.
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/nint-nuint