Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » compressed serialization
compressed serialization [message #23028] Wed, 09 September 2009 02:56 Go to next message
nixnixnix is currently offline  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?

Nick
Re: compressed serialization [message #23029 is a reply to message #23028] Wed, 09 September 2009 05:59 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
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.


Regards,
Novo
Re: compressed serialization [message #23030 is a reply to message #23029] Wed, 09 September 2009 08:41 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Maybe it is possible to unzip file into memory, then load from it as Stream?
Re: compressed serialization [message #23037 is a reply to message #23030] Wed, 09 September 2009 21:14 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
Mindtraveller wrote on Wed, 09 September 2009 02:41

Maybe it is possible to unzip file into memory, then load from it as Stream?


That is definitely possible Wink You just need to unzip one stream into another. Who cares about memory these days ...


Regards,
Novo
Re: compressed serialization [message #23038 is a reply to message #23037] Thu, 10 September 2009 03:01 Go to previous message
Mindtraveller is currently offline  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.
Previous Topic: ConvertInt > templatable Convert<T>
Next Topic: Error when I trying to Add in VectorMap container a "C" struct
Goto Forum:
  


Current Time: Tue Apr 16 13:39:03 CEST 2024

Total time taken to generate the page: 0.01707 seconds