03-01-2013 09:28 AM
OpenG Zip is a Labview Addon. that i have installed. the package claims to support *streaming*, i.e. zipping on the fly rather than from a file on disc. it is not clear to me how to implement that.
tips or example code would be muchly appreciated.
Solved! Go to Solution.
03-04-2013 02:47 AM - edited 03-04-2013 02:53 AM
Streaming is mostly transparent. The only difference to file IO based ZIP operations is in the Open function (both ZIP and Unzip), which you have to select to use the Stream version instead of the File version. In the case of the UNZIP variant you pass it the ZIP stream as a string, in the case of the ZIP variant you get the ZIP stream back at the end when you close the ZIP refnum.
Since LabVIEW is still treating strings and byte arrays as the same I figured that using a string control for the stream is the easier solution. In the future as LabVIEW strings might get encoding sensitive it may be necessary to change them to byte arrays instead but until now that didn't make much sense.
Since LabVIEW does not have a true streaming infrastructure that all other functions like Network and FIle IO would use, there was no way to implement a truely streaming interface to the ZIP library without supplying according Network and File IO functions too. So you will have to live with the fact that you have to ZIP up the entire archive first no matter what. But with the streaming support you can bypass the need to write everything to disk first. As such the name was maybe not ideally chosen, as it is more File based and Memory based (Un)Zipping.