Exemplo n.º 1
0
 internal static void DeserializeChecked <TCreation>(ref T instance, SerializationContext source)
     where TCreation : class, T
 {
     if (readProps == null)
     {
         Build();
     }
     //if (instance == null) throw new ArgumentNullException("instance");
     if (source == null)
     {
         throw new ArgumentNullException("source");
     }
     Deserialize <TCreation>(ref instance, source);
     source.CheckStackClean();
 }
Exemplo n.º 2
0
        internal static int SerializeChecked(T instance, SerializationContext destination)
        {
            if (readProps == null)
            {
                Build();
            }
            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }
            if (destination == null)
            {
                throw new ArgumentNullException("destination");
            }

            int len = Serialize(instance, destination);

            destination.CheckStackClean();
            destination.Flush();
            return(len);
        }