HI Here is my scenario when I need to serialize an object to a file.
I use binary format to serialize an object like,
IFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream1, object);
I write GetObjectData () as follows:
serinfo.AddValue("string1",objecta);
serinfo.AddValue("string2",objectb);
serinfo.AddValue("string3",objectc);
I am serializing 2 lists list1, list2 in object b. sizeof lists change from time to time (each list may also contain 100,000 elements .. means that the number of elements in the list affects the size of the stream). So, when I serialize an object, the size of my stream should not exceed 10 MB, and if I have to write it in another stream. just say if the size exceeds 10 MB, I should have another stream, and each stream should be in the following format
stream1 --> objecta,(objectb)some n values in list,objectc
stream2 --> objecta,(objectb)values in list from n+1 to some m,objectc
..
streamn --> ........
The size of each stream should be limited to 10 MB.
, , .
..
( qn..: P)