addLiteral (filename : string, xlink : string, encoding : string) : void
The method »addLiteral()« can be used to add a text file to the .zip. Text file just means here a file produced by means of a literal method, unlike a binary file, which is produced using a binary method.
Examples of text files are files with the endings .txt or .csv. HTML or CSS files can also be produced in this way.
Parameter
The name under which the file is to be listed in the .zip later on is to be transferred to the first parameter »filename«.
An XLink to the literal method, which produces the file, is transferred to the parameter »xlink«.
The encoding of the later text file is transferred to the parameter »encoding«.
Example
The following example produces an empty .zip binary stream, adds a .csv file, and lastly produces the .zip file.
It is to be noted that the method specified in the XLink may have no more than the access protection »protected«.