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

Method WriteNamedTypeInfo

csharp/src/Fory/TypeResolver.cs:613–637  ·  view source on GitHub ↗
(Type type, TypeInfo typeInfo, WriteContext context)

Source from the content-addressed store, hash-verified

611 }
612
613 private void WriteNamedTypeInfo(Type type, TypeInfo typeInfo, WriteContext context)
614 {
615 if (context.Compatible)
616 {
617 TypeInfo.TypeMetaCacheEntry typeMeta = typeInfo.GetTypeMetaCacheEntry(context.TrackRef);
618 context.WriteTypeMeta(type, typeMeta.EncodedBytes);
619 return;
620 }
621
622 if (!typeInfo.NamespaceName.HasValue || !typeInfo.TypeName.HasValue)
623 {
624 throw new InvalidDataException("missing type name metadata for name-registered type");
625 }
626
627 WriteMetaString(
628 context,
629 typeInfo.NamespaceName.Value,
630 TypeMetaEncodings.NamespaceMetaStringEncodings,
631 MetaStringEncoder.Namespace);
632 WriteMetaString(
633 context,
634 typeInfo.TypeName.Value,
635 TypeMetaEncodings.TypeNameMetaStringEncodings,
636 MetaStringEncoder.TypeName);
637 }
638
639 internal void ReadTypeInfo<T>(Serializer<T> serializer, ReadContext context)
640 {

Callers

nothing calls this directly

Calls 2

GetTypeMetaCacheEntryMethod · 0.80
WriteTypeMetaMethod · 0.80

Tested by

no test coverage detected