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

Method WriteAnyTypeInfo

csharp/src/Fory/AnySerializer.cs:147–162  ·  view source on GitHub ↗
(object value, WriteContext context)

Source from the content-addressed store, hash-verified

145public static class DynamicAnyCodec
146{
147 internal static void WriteAnyTypeInfo(object value, WriteContext context)
148 {
149 if (DynamicContainerCodec.TryGetTypeId(value, out TypeId containerTypeId))
150 {
151 context.Writer.WriteUInt8((byte)containerTypeId);
152 return;
153 }
154
155 if (TryWriteKnownTypeInfo(value, context))
156 {
157 return;
158 }
159
160 TypeInfo typeInfo = context.TypeResolver.GetTypeInfo(ResolveRuntimeType(value));
161 context.TypeResolver.WriteTypeInfo(typeInfo, context);
162 }
163
164 internal static Type ResolveRuntimeType(object value)
165 {

Callers 3

WriteDynamicMapPairsMethod · 0.80
WriteMethod · 0.80
WriteDynamicMapPairsMethod · 0.80

Calls 4

TryGetTypeIdMethod · 0.80
WriteUInt8Method · 0.80
GetTypeInfoMethod · 0.45
WriteTypeInfoMethod · 0.45

Tested by

no test coverage detected