I have some data in an array,
uchar *data = "Data to be compressed."; [Some data]
I want to compress(gz) this data and get output in a buffer.
uchar gzData[MAX_LEN];
One way to do this is:
1. Creating a `ogzstream` object.
2. Writing this data into a temporary file
3. close the temporary file.
3. Create a `ifstream` object.
4. Read the temporary file into buffer using ifstream object .
But I do not want to use a temporary file for this as it is slowing down the whole process.
Is there any direct method of compressing this data without using any intermediate file ??