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

Method ReadAnyTypeInfo

csharp/src/Fory/TypeResolver.cs:999–1026  ·  view source on GitHub ↗
(ReadContext context)

Source from the content-addressed store, hash-verified

997 }
998
999 internal TypeInfo ReadAnyTypeInfo(ReadContext context)
1000 {
1001 uint rawTypeId = context.Reader.ReadUInt8();
1002 if (!IsKnownTypeId(rawTypeId))
1003 {
1004 throw new InvalidDataException($"unknown type id {rawTypeId}");
1005 }
1006
1007 TypeId wireTypeId = (TypeId)rawTypeId;
1008 switch (wireTypeId)
1009 {
1010 case TypeId.CompatibleStruct:
1011 case TypeId.NamedCompatibleStruct:
1012 return ReadAnyTypeInfo(wireTypeId, context.Compatible, context);
1013 case TypeId.NamedEnum:
1014 case TypeId.NamedStruct:
1015 case TypeId.NamedExt:
1016 case TypeId.NamedUnion:
1017 return ReadNamedAnyTypeInfo(wireTypeId, context);
1018 case TypeId.Struct:
1019 case TypeId.Enum:
1020 case TypeId.Ext:
1021 case TypeId.TypedUnion:
1022 return ResolveAnyUserTypeInfo(wireTypeId, context.Reader.ReadVarUInt32(), context.Compatible);
1023 default:
1024 return ResolveAnyBuiltInTypeInfo(wireTypeId);
1025 }
1026 }
1027
1028 private TypeInfo ReadNamedAnyTypeInfo(TypeId wireTypeId, ReadContext context)
1029 {

Callers 6

SkipListOrSetMethod · 0.45
SkipMapMethod · 0.45
ReadDataMethod · 0.45
ReadDataMethod · 0.45
ReadNonNullPayloadMethod · 0.45

Calls 14

ReadUInt8Method · 0.80
ReadVarUInt32Method · 0.80
TryReadTypeMetaRefMethod · 0.80
StoreTypeMetaMethod · 0.80
ReadUInt64Method · 0.80
SkipBodyMethod · 0.80
StoreTypeMetaRefMethod · 0.80
MoveBackMethod · 0.80
DecodeTypeMetaMethod · 0.80

Tested by

no test coverage detected