Binaryformaterserializer Class (Networkcomms 2.3.1 source knowledge and learning)

Source: Internet
Author: User

Networkcomms.net2.3.1 Open source version, based on GPL V3 protocol. Because the 3.x version of the source code can not be published, so based on this version of learning.3. There are many improvements and bug fixes in the X version, and there is little difference in how to use them. /*Please note that the following code is required to comply with the GPLV3 protocol*/#ifWindows_phone#elseusingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Runtime.Serialization.Formatters.Binary;usingSystem.IO;#ifAndroidusingPreserveattribute =Android.Runtime.PreserveAttribute;#elifIosusingPreserveattribute =MonoTouch.Foundation.PreserveAttribute;#endifnamespacedpsbase{///. NET comes with a serializer/// </summary>[Dataserializerprocessor (2)]     Public classBinaryformaterserializer:dataserializer {StaticDataserializer instance; [Obsolete ("Instance access via class obsolete, use dpsmanager.getserializer<t>")]         Public StaticDataserializer Instance {Get            {                if(Instance = =NULL) Instance= getinstance<binaryformaterserializer>(); returninstance; }        }#ifANDROID | | Ios[Preserve]#endif        PrivateBinaryformaterserializer () {}#regionIserialize Members/// <inheritdoc/>        ///serializing objects into binary data        protected Override voidSerialisedataobjectint (Stream Ouputstream,ObjectObjecttoserialise, dictionary<string,string>options) {BinaryFormatter Formatter=NewBinaryFormatter (); Formatter.            Serialize (Ouputstream, objecttoserialise); Ouputstream.seek (0,0); }        /// <inheritdoc/>        ///serializing binary data into objects        protected Override ObjectDeserialisedataobjectint (Stream InputStream, Type Resulttype, dictionary<string,string>options) {BinaryFormatter Formatter=NewBinaryFormatter (); returnFormatter.        Deserialize (InputStream); }        #endregion    }}#endifhttp://Www.cnblogs.com/networkcommshttp//www.networkcoms.cn Edit

Binaryformaterserializer Class (Networkcomms 2.3.1 source knowledge and learning)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.