Example #1
0
        public override int Serialize(TSource source, SerializationContext context)
        {
            uint value = GetValue(source);

            if (IsOptional && value == DefaultValue)
            {
                return(0);
            }
            return(WritePrefix(context) + context.EncodeInt32Fixed((int)value));
        }