Example #1
0
        public static T FromXml(string xml)
        {
            TMemoryBuffer trans = new TMemoryBuffer(Encoding.UTF8.GetBytes(xml));
            TProtocol     prot  = new TXmlProtocol(trans);

            return(Proto <T> .Read(prot));
        }
Example #2
0
        public static string GetXml(T value)
        {
            TMemoryBuffer trans = new TMemoryBuffer();
            TXmlProtocol  prot  = new TXmlProtocol(trans);

            Proto <T> .Write(prot, value);

            trans.Flush();
            return(Encoding.UTF8.GetString(trans.GetBuffer()));
        }