Prev: bowman game
Next: a question about Wind Turbine Doubly-Fed Induction Generator (Phasor Type)1 in demo
From: Andrea Arteaga on 27 Apr 2010 01:17 I'm writing a C++ library for data exchange between C++ and Matlab through MAT files. Now, Matlab compresses the data using zlib before writing it to the file. When I open the file with C++, I can read the information about the size of the compressed data, but I also need the information about the decompressed size, since I have to allocate enough memory. [url=http://www.zlib.net/manual.html]From zlib manual[/url]: "The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some mechanism outside the scope of this compression library." How can I have this information?
From: Chris Hulbert on 27 Apr 2010 09:04
On Apr 27, 5:17 am, Andrea Arteaga <andyspi...(a)gmail.com> wrote: > I'm writing a C++ library for data exchange between C++ and Matlab through MAT files. Now, Matlab compresses the data using zlib before writing it to the file. When I open the file with C++, I can read the information about the size of the compressed data, but I also need the information about the decompressed size, since I have to allocate enough memory. > > [url=http://www.zlib.net/manual.html]From zlib manual[/url]: "The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some mechanism outside the scope of this compression library." > > How can I have this information? You have to inflate the variable header and figure out the size from the data type and dimensions. Chris |