Insert some data at later point once serialization(binary serialization) is done for a class

Posted by coolcake on Stack Overflow See other posts from Stack Overflow or by coolcake
Published on 2010-05-27T01:40:07Z Indexed on 2010/05/27 1:41 UTC
Read the original article Hit count: 639

Filed under:
|

My application is written in C# and I am a newbie to C#. I am facing with a problem during serialization. The problem is as follows.

There are many classes in my project and when serialization is called on one of the main class object it serializes itself and during this process many of the member objects are also get serialized. This whole serialization is done in to a file with extension say ".bin". This bin file size should be of size max 20MB.

In this process of serialization one of my other class also gets serialized to a stream, this class is having a big array. The size of this array or list can be of 80 MB or more. So during serialization i have serialize all the objects other than this array and depending upon the size left in the 20MB I need to add in between the serialization the number of array elements which can fit in the remaining memory.

For the other array elements left out I have to create a similar kind of .bin file with all the objects serialized and in between need to insert the number of array elements that can fit there.

The main problem here is the array elements get inserted at runtime and this list keeps on increasing. So i should be creating .bin files continuously until my application runs.

Any ideas how can i implement a solution for this problem?

Thanks in Advance.

© Stack Overflow or respective owner

Related posts about c#

Related posts about serialization