예제 #1
0
 /// <summary>
 /// 使用缓冲区序列化
 /// </summary>
 /// <param name="graph"></param>
 /// <param name="stream"></param>
 public static void BinarySerialize(ObjectWriter stream, object graph)
 {
     ObjectBufferSerializer.Serialize(stream, graph);
 }
예제 #2
0
        //public static T Deserialize<T>(string value, SerializerSettings settings) where T : class
        //{
        //    throw new Exception("Not supported,it will implementation in next versions");
        //}

        //public static T FromJson<T>(this string json) where T : class
        //{
        //    //return Deserialize<T>(new JsonStream());
        //    throw new Exception("Not supported,it will implementation in next versions");
        //}

        #endregion

        #region Bin Serialize

        /// <summary>
        /// 序列化成二进制数据
        /// </summary>
        /// <param name="graph"></param>
        /// <returns></returns>
        public static byte[] BinarySerialize(object graph)
        {
            return(ObjectBufferSerializer.Serialize(graph));
        }