customserializer.cs

来自「Perst开源实时数据库」· CS 代码 · 共 35 行

CS
35
字号
using System;
using System.IO;

namespace Perst
{
    /// <summary>
	/// Interface of custome serializer
	/// </summary>
	public interface CustomSerializer
	{
        /// <summary>
        /// Serialize object
        /// </summary>
        /// <param name="obj">object to be packed</param>
        /// <param name="output">output stream to which object should be serialized</param>
        ///
        void Pack(CustomSerializable obj, Stream output);

        /// <summary>
        /// Deserialize object
        /// </summary>
        /// <param name="input">input stream from which object should be deserialized</param>
        /// <returns>unpacked object</returns>
        ///
        CustomSerializable Unpack(Stream input);

        /// <summary>
        /// Create object from its string representation
        /// </summary>summary>
        /// <param name="str">string representation of object (created by ToString() method)</param>
        ///
        CustomSerializable Parse(String str);
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?