![ContractedBlock.gif](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
using
System.Runtime.Serialization.Formatters.Binary;
using System.IO;
using (Stream s = (Stream)( new MemoryStream()))
{
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(s, your_obj);
s.Position = 0 ;
your_obj_next = (your_obj_type)bf.Deserialize(s);
}
using System.IO;
using (Stream s = (Stream)( new MemoryStream()))
{
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(s, your_obj);
s.Position = 0 ;
your_obj_next = (your_obj_type)bf.Deserialize(s);
}