示例#1
0
 public override string Serialize(object serializable)
 {
     Initialize();
     using (var ms = new MemoryStream())
     {
         _serializer.Pack(ms, serializable);
         ms.Flush();
         ms.Position = 0;
         return(Convert.ToBase64String(ms.ToArray()));
     }
 }
示例#2
0
 public override void Serialize(object root, Stream stream)
 {
     m_Serializer.Pack(stream, root);
 }