compressToBinary

compressToBinary(typeAndOption: Integer): Binary;

The compressToBinary method of the Binary primitive type returns a compressed binary representation of the binary of the receiver using the ZLIB compression value specified by the typeAndOption parameter, which can be one of the Binary primitive type constants listed in the following table.

Constant Integer Value Description
Compression_ZLib 1402 String and binary compression to binary using ZLIB level 5 (256*5 + 122)
Compression_ZLibFast 378 String and binary compression to binary using ZLIB level 1 (256*1 + 122)
Compression_ZLibSmall 2426 String and binary compression to binary using ZLIB level 9 (256*9 + 122)

This method adds the type byte to the front of the compressed binary. This type byte is ignored when the value is used in a JADE system but if the data is to be passed to an external library, it is your responsibility to remove the type byte, if necessary.

You cannot concatenate the results of multiple compressToBinary method calls.

You must use the Binary primitive type uncompressToBinary method to uncompress a binary value from this binary representation.