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

Method TryReadTypeMetaRef

csharp/src/Fory/ReadContext.cs:260–279  ·  view source on GitHub ↗
(out int index, out TypeMeta typeMeta)

Source from the content-addressed store, hash-verified

258 }
259
260 internal bool TryReadTypeMetaRef(out int index, out TypeMeta typeMeta)
261 {
262 uint indexMarker = Reader.ReadVarUInt32();
263 bool isRef = (indexMarker & 1) == 1;
264 index = checked((int)(indexMarker >> 1));
265 if (isRef)
266 {
267 TypeMeta? cached = GetTypeMetaRef(index);
268 if (cached is null)
269 {
270 throw new InvalidDataException($"unknown type meta ref index {index}");
271 }
272
273 typeMeta = cached;
274 return true;
275 }
276
277 typeMeta = null!;
278 return false;
279 }
280
281 [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
282 internal bool MatchesExactLocalTypeMeta(TypeMeta typeMeta, int start, int end)

Callers 3

ReadTypeInfoCoreMethod · 0.80
ReadNamedTypeInfoMethod · 0.80
ReadAnyTypeInfoMethod · 0.80

Calls 1

ReadVarUInt32Method · 0.80

Tested by

no test coverage detected