Can List support loading existing file

Nov 13, 2010 at 4:12 PM


Thanks for the great work. Can List support loading existing file?

- Erison

Nov 14, 2010 at 10:30 AM

As of right now it is not supported, but modifying the code to support it should not be to hard.

I have it on my todo list, and in order to support it you would also need to save information about which serializer was used. The last six months I have had little time to continue the library, but moving it over to .Net 4 is priority one, then add some more functionality.



Nov 15, 2010 at 4:07 AM

I've try to modify your can that add a "RecordHeader" structure to keep information (Length for Array<T> and Count for List<T>) in Array<T> class. This information will be kept in backend memory mapped file. Do you think it is necessary to keep serializer? Why?

BTW: Is it still possible to use this great libarary in .NET 2 after porting to .NET 4? Can there two versions for .NET 4 and .NET 2 (since .NET 3 and .NET 3.5 are based on 2.0)?


Best regards,

- Erison

Nov 15, 2010 at 7:07 PM

If you use the automatic serializer code you don´t really know which one was used, and the timings could differ the second time around for certain types. In order to read the data back correctly it should be read with the correct deserializer code to make sure everything is the same as when you serialized it. Depending on your data structure the data might serialize differently with the different serializers.

I will keep the old code as well when I port to .Net 4. The main reason for porting to .Net 4 is that it has built in capabilities to work with memory mapped files. I have some thoughts on optimizations and refactoring so I should be able to get both .Net 2.0 and 4.0 working with the same code by implementing a better interface for the backend storage.