A
andrewcw
I have an object to serialize.
[ this works ]
TextWriter writer = new StreamWriter("test.xml");
serializer.Serialize(writer,obj);
writer.Close();
but below does not, why ?? I have a file that I will have
exclusively opened & I use the stream for that operation.
[ error mess Value cannot be null.\r\nParameter name:
stream ] THANKS { I am tring to push the object back into
the stream )
FileStream stream = null;
serializer.Serialize(stream,obj); // CRASH
System.IO.StreamWriter Tout = new System.IO.StreamWriter
(stream);
stream.Position=0;
Tout.Close();
[ this works ]
TextWriter writer = new StreamWriter("test.xml");
serializer.Serialize(writer,obj);
writer.Close();
but below does not, why ?? I have a file that I will have
exclusively opened & I use the stream for that operation.
[ error mess Value cannot be null.\r\nParameter name:
stream ] THANKS { I am tring to push the object back into
the stream )
FileStream stream = null;
serializer.Serialize(stream,obj); // CRASH
System.IO.StreamWriter Tout = new System.IO.StreamWriter
(stream);
stream.Position=0;
Tout.Close();