2.11 Compressed OAB Version 4 Details File and Compressed OAB Template File

 Uncompressed Details and display template files can be very large due to the amount of information stored. In order to reduce the network traffic between the client and the server, the server transmits these files in a compressed form. A compressed file starts with a LZX_HDR structure followed by one or more LZX_BLK structures. The LZX_HDR structure contains a maximum block size field that is used to tell the client the maximum size of a block it can expect to have to read from the compressed file and the maximum size of a block it can expect to have to write to an output file. It is passed so that the client can pre-allocate buffers before attempting to decompress a file. Also included in the compressed Details or display template file is a length field that indicates what the size of the resulting decompressed file will be. It is provided to help the client allocate disk storage and determine whether the resulting output file size is correct.

Each LZX_BLK structure contains a flag indicating whether the data field is compressed. If the size of a compressed block is larger than the source data, the server might choose to not compress the block and just pass it verbatim. A CRC hash of the expected decompressed output block is passed to the client to help it determine if the results of decompression are valid.

The following ABNF definition shows the format of a compressed OAB version 4 Details file and a compressed OAB Template file.

 v4-compressed-file = LZX_HDR 1*LZX_BLK