cniWriteBuffer

Use this function to write the syntax element tree associated with the specified message to the data buffer that is owned by the message object. This function is typically used by output nodes.

This operation serializes the element tree into a bit stream that can then be processed as a sequence of contiguous bytes. This function should be used when writing the bit stream to a target that is outside the integration node.

You must call cniFinalize before this call, or cniWriteBuffer fails.

Syntax

void cniWriteBuffer(
  int*         returnCode,
  CciMessage*  message);

Parameters

returnCode
The return code from the function (output).
Possible return codes are:
  • CCI_SUCCESS
  • CCI_EXCEPTION
  • CCI_INV_MESSAGE_OBJECT
message
The address of the message object for which the element tree is to be serialized (input).

Return values

None. If an error occurs, the returnCode parameter indicates the reason for the error.

Example

cniCopyElementTree(&rc, inLastChild, outLastChild);
cniFinalize(&rc, outMessage);
cniWriteBuffer(&rc, outMessage);