LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OpenG Zip... Streaming

Solved!
Go to solution

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.

0 Kudos
Message 1 of 2
(2,439 Views)
Solution
Accepted by topic author larry2

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(2,408 Views)