Static methods:

Lib.Sys.Zip.Compress.run(bytes, level)

Compress bytes with level of compression.

Return compresed Bytes object.

bytes - Bytes object

level - level of compression, int


Examples:


text = "test test test test test"

print(string.len(text))

bytesForCompression = Lib.Sys.IO.Bytes.ofString(text)

compressedBytes = Lib.Sys.Zip.Compress.run(bytesForCompression, 7)

print(compressedBytes.length)

print(compressedBytes.toHex())


uncompressedBytes = Lib.Sys.Zip.Uncompress.run(compressedBytes, nil)

print(uncompressedBytes.length)

print(uncompressedBytes.toString())

Created with the Personal Edition of HelpNDoc: Free EPub producer