(ReadContext context)
| 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 | { |
no test coverage detected