Hey guys.
Playing around with opening up a compressed file inside of cinder. Looking at the buffer class, there is a decompressBuffer function which seems to allow for gzip decompression. Here is the relevant line in the cinder source https://github.com/cinder/Cinder/blob/master/src/cinder/Buffer.cpp#L148 . This is how I’m trying to do it.
auto inFile = loadFile("compressedTextFile.txt");
Buffer loadedBuf(inFile);
Buffer decom = decompressBuffer(loadedBuf, true, true);
string dString( static_cast<const char*>( decom.getData() ) );
console () << loadedBuf.getSize() << endl; // the correct size
console () << decom.getSize() << endl; // this is 0
My decompressed buffer is always 0. Am I doing this wrong? For reference, I can type “unzip compressedTextFile.txt” in the terminal and it will unpack correctly.
Thanks!
-c