@@ -82,6 +82,22 @@ public static object Deserialize(Type type, ReadOnlySequence<byte> bytes, Messag
82
82
return GetOrAdd ( type ) . Deserialize_ReadOnlySequence_Options_CancellationToken . Invoke ( bytes , options , cancellationToken ) ;
83
83
}
84
84
85
+ /// <summary>
86
+ /// Helper method used by reflection.
87
+ /// </summary>
88
+ private static void SerializeSemiGeneric < T > ( ref MessagePackWriter writer , object valueObject , MessagePackSerializerOptions options = null )
89
+ {
90
+ Serialize ( ref writer , ( T ) valueObject , options ) ;
91
+ }
92
+
93
+ /// <summary>
94
+ /// Helper method used by reflection.
95
+ /// </summary>
96
+ private static object DeserializeSemiGeneric < T > ( ref MessagePackReader reader , MessagePackSerializerOptions options = null )
97
+ {
98
+ return Deserialize < T > ( ref reader , options ) ;
99
+ }
100
+
85
101
private static async ValueTask < object > DeserializeObjectAsync < T > ( Stream stream , MessagePackSerializerOptions options , CancellationToken cancellationToken ) => await DeserializeAsync < T > ( stream , options , cancellationToken ) . ConfigureAwait ( false ) ;
86
102
87
103
private static CompiledMethods GetOrAdd ( Type type )
@@ -219,8 +235,8 @@ internal CompiledMethods(Type type)
219
235
}
220
236
221
237
{
222
- // public static void Serialize <T>(ref MessagePackWriter writer, T obj, MessagePackSerializerOptions options)
223
- MethodInfo serialize = GetMethod ( nameof ( SerializeSemiGeneric ) , type , new Type [ ] { typeof ( MessagePackWriter ) . MakeByRefType ( ) , typeof ( Object ) , typeof ( MessagePackSerializerOptions ) } ) ;
238
+ // private static void SerializeSemiGeneric <T>(ref MessagePackWriter writer, object obj, MessagePackSerializerOptions options)
239
+ MethodInfo serialize = GetMethod ( nameof ( SerializeSemiGeneric ) , type , new Type [ ] { typeof ( MessagePackWriter ) . MakeByRefType ( ) , typeof ( object ) , typeof ( MessagePackSerializerOptions ) } ) ;
224
240
#if ENABLE_IL2CPP
225
241
this . Serialize_MessagePackWriter_T_Options = ( ref MessagePackWriter x , object y , MessagePackSerializerOptions z ) => ThrowRefStructNotSupported ( ) ;
226
242
#else
@@ -229,7 +245,7 @@ internal CompiledMethods(Type type)
229
245
}
230
246
231
247
{
232
- // public static T Deserialize <T>(ref MessagePackReader reader, MessagePackSerializerOptions options)
248
+ // private static object DeserializeSemiGeneric <T>(ref MessagePackReader reader, MessagePackSerializerOptions options)
233
249
MethodInfo deserialize = GetMethod ( nameof ( DeserializeSemiGeneric ) , type , new Type [ ] { typeof ( MessagePackReader ) . MakeByRefType ( ) , typeof ( MessagePackSerializerOptions ) } ) ;
234
250
#if ENABLE_IL2CPP
235
251
this . Deserialize_MessagePackReader_Options = ( ref MessagePackReader reader , MessagePackSerializerOptions options ) => { ThrowRefStructNotSupported ( ) ; return null ; } ;
0 commit comments