nixnixnix Messages: 415 Registered: February 2007 Location: Kelowna, British Columbia
Senior Member
Is it possible to combine Z compression (or any other kind of compression) with the built in serialization functions such as LoadFromFile and StoreToFile? If so, is there an example of this please?
If its not possible to do that, is it possible to write and read compressed serialized files without writing the uncompressed version to disk and with uncompressed file sizes in the hundreds of megabytes or more?
IMO, that is not possible.
LoadFromFile/StoreToFile just open a FileStream and call Load/Store using this stream. In order to use compressed serialized files you need to have compression/decompression algorithms, which behave as streams, and bind compression streams with regular streams in a filter-like way. IMO that is not possible right now.
Mindtraveller Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
Experienced Contributor
You may create some proxy class like MyClassZippedSerializer which will compress/decompress your inner MyClass serialized data then save it to file. Using this technique you may even partially read/write your serialized data to make memory consumption close to theoretical minimum.