MCPcopy Create free account
hub / github.com/apache/fory / ReadData

Method ReadData

csharp/src/Fory/EnumSerializer.cs:38–47  ·  view source on GitHub ↗
(ReadContext context)

Source from the content-addressed store, hash-verified

36 }
37
38 public override TEnum ReadData(ReadContext context)
39 {
40 uint ordinal = context.Reader.ReadVarUInt32();
41 if (DefinedOrdinalToValue.TryGetValue(ordinal, out TEnum value))
42 {
43 return value;
44 }
45
46 return (TEnum)Enum.ToObject(typeof(TEnum), ordinal);
47 }
48
49 private static Dictionary<TEnum, uint> BuildValueToOrdinalMap()
50 {

Callers

nothing calls this directly

Calls 2

ReadVarUInt32Method · 0.80
TryGetValueMethod · 0.45

Tested by

no test coverage detected