def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
local_buffer = utils.BytearrayStream()<EOL>if self._query_functions:<EOL><INDENT>for query_function in self._query_functions:<EOL><INDENT>query_function.write(local_buffer, kmip_version=kmip_version)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise exceptions.InvalidField(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>self.length = local_buffer.length()<EOL>super(QueryRequestPayload, self).write(<EOL>output_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL>output_buffer.write(local_buffer.buffer)<EOL>
Write the data encoding the QueryRequestPayload object to a stream.

Args:
    output_buffer (Stream): A data stream in which to encode object
        data, supporting a write method; usually a BytearrayStream
        object.
    kmip_version (KMIPVersion): An enumeration defining the KMIP
        version with which the object will be encoded. Optional,
        defaults to KMIP 1.0.

Raises:
    InvalidField: Raised if the query functions are not defined.