Exemplo n.º 1
0
        protected byte[] UnsafeSerialize(TWrite msg)
        {
            DefaultSerializationContext context = null;

            try
            {
                context = DefaultSerializationContext.GetInitializedThreadLocal();
                serializer(msg, context);
                return(context.GetPayload());
            }
            finally
            {
                context?.Reset();
            }
        }
Exemplo n.º 2
0
 // runs the serializer, propagating any exceptions being thrown without modifying them
 protected SliceBufferSafeHandle UnsafeSerialize(TWrite msg, DefaultSerializationContext context)
 {
     serializer(msg, context);
     return(context.GetPayload());
 }