示例#1
0
        public override dynamic Serialize(object thisObj)
        {
            DoCopyIfNotCheating((T)thisObj);

            using (var ms = new MemoryStream())
            {
                var tproto = new TCompactProtocol(new TStreamTransport(ms, ms));
                CodeGenObjSer.Write(tproto);
                SerBytes = ms.ToArray();
            }

            return(SerBytes);
        }
示例#2
0
 protected override InheritedEntityThrift ToSerObject(T thisObj)
 {
     CodeGenObjSer = base.ToSerObject(thisObj);
     CodeGenObjSer.InjectFrom <FloatToDouble>(thisObj); // special call to inject the float (C#) into the double (thrift)
     return(CodeGenObjSer);
 }