Runtimeserialization

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ct as a file or send objects over a network Taking such a "snapshot" is difficult because Objects often contain other objects Object variables and fields are references References are addresses; meaningless when saved The entire process is called serialization Only works on classes marked [Serializable] Serializing an Array Let's use serialization to write an entire array to disk Add namespaces System.Runtime.Serialization System.Runtime.Serialization.Formatters.Binary Create a BinaryFormatter using default constructor Open a FileStream (or any stream) for output Call the formatter's Serialize() method to write data To deserialize, call the Deserialize() method You have to cast the returned value to the correct type Can also use the SoapFormatter for XML storage 28 I/O and Networking System.Net System.Net contains all network protocol support Low-level support for IP sockets Application level protocol implementations (HTTP) Authentication methods for HTTP Basic, Digest, NTLM Challen...
View Full Document

This note was uploaded on 04/04/2014 for the course CS 5950 taught by Professor Staff during the Summer '08 term at Western Michigan.

Ask a homework question - tutors are online