C
Cip
I have a question using Binary Serialization (not XML).
If I have two objects, A and B, can I serialize both of them to the
SAME file ?
I KNOW I can put objects A and B in a container class and just
serialize it, but that is NOT what I am asking.
In other words, I want to *independently* serialize two or more
objects to the same output file stream.
As well, I want to somehow deserialize each object separately.
(Instead of deserializing an entire File Stream at once, I want to
somehow specify what part of the File Stream I would like to
deserialize)
in pseudocode:
Object myObjA;
Object myObjB;
FILE = "test.bin"
Serialize(myObjA,FILE,ObjectIndex1)
Serialize(myObjB,FILE,ObjectIndex2)
//and then to deserialize only one of the "ObjectIndex" from the FILE
Object myObjC = Deserialize(FILE,ObjectIndex1)
Is that possible? how can I achieve that? any links?
Which NG should I post to?
You may be asking WHY I need to do this... well if I have a Collection
or an Array with 10,000,000, items I do not want to
serialize/deserialize all of it at once as it can take a while.
I would like to somehow organize the data in smaller chunks, so that I
will only serialize/deserialize the chunks that are needed by the
users. If I can work independently with many objects in one file then
I can achieve this.
Thanks a lot,
Cip
If I have two objects, A and B, can I serialize both of them to the
SAME file ?
I KNOW I can put objects A and B in a container class and just
serialize it, but that is NOT what I am asking.
In other words, I want to *independently* serialize two or more
objects to the same output file stream.
As well, I want to somehow deserialize each object separately.
(Instead of deserializing an entire File Stream at once, I want to
somehow specify what part of the File Stream I would like to
deserialize)
in pseudocode:
Object myObjA;
Object myObjB;
FILE = "test.bin"
Serialize(myObjA,FILE,ObjectIndex1)
Serialize(myObjB,FILE,ObjectIndex2)
//and then to deserialize only one of the "ObjectIndex" from the FILE
Object myObjC = Deserialize(FILE,ObjectIndex1)
Is that possible? how can I achieve that? any links?
Which NG should I post to?
You may be asking WHY I need to do this... well if I have a Collection
or an Array with 10,000,000, items I do not want to
serialize/deserialize all of it at once as it can take a while.
I would like to somehow organize the data in smaller chunks, so that I
will only serialize/deserialize the chunks that are needed by the
users. If I can work independently with many objects in one file then
I can achieve this.
Thanks a lot,
Cip