ZIP - inflating and deflating (.z and .gz format) strings using zlib

Downloaded 20 times
Average rating
(0 votes)

This XOP will inflate and deflate strings that contain information encoded in .z and .gz formats. It will not handle .zip or multifile zip files. The encoding is done in .gz format.

It is based on the free zlib library.

Useage:

string test = "0123456789"
string test2 = zipencode(test)
string test3 = zipdecode(test2)
print test3

or

variable fileID
open/r fileID      //open a .gz file
fStatus fileID    //get the length of the file in bytes
string inData = "" 
inData = padstring(indata,V_logEOF,0)   //make the indata string as long as the fileitself
fbinread fileiD, inData //read in the data
string unzippedData = zipdecode(inData)   //unzip the data in the string
close(fileID)

This can be useful for zipping and unzipping waves using the SOCKIT.xop. (This has commands SOCKITstringtoWave and SOCKITwavetostring).

Releases

Development snapshotsDateSizeLinks
IGOR.5.04.x-1.x-dev2008-Sep-18219.44 KB

Back to top