2.3.3.2.2 Filling in the Header

Using the fields defined in the RTF compression ABNF grammar, as specified in section 2.1.3.1.1, the writer MUST fill in the header by using the following process:

  1. Set the COMPSIZE field of the header to the number of CONTENTS bytes in the output buffer plus 12.

  2. Set the RAWSIZE field of the header to the number of bytes read from the input.

  3. Set the COMPTYPE field of the header to COMPRESSED.

  4. Set the CRC field of the header to the value of the CRC field generated from the CONTENTS field. The value of the CRC field, as specified in section 2.1.3.1.1, MUST be calculated from every byte in the CONTENTS field by using the process specified in section 2.1.3.2.