create (level : number) : void
A new. zip binary stream can be produced with the method »create()«.
Parameter
The parameter »level« indicates the degree of compression here. This is represented by a number between 0 and 10.
The choice of the compression degree should be made conditional on the contents of the .zip file. If mainly .jpeg pictures are to be zipped, a compression level of 0 makes good sense since the files are already compressed. Further compression could have a negative effect on the quality.
Usage
Usually, an empty .zip binary stream is created first with »create()«. This is then filled gradually with contents. The binary stream is then completed with the method »finish()«, meaning the file can be produced via a <b:output /> element.
Example
The following example produces an empty .zip file.