def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_3):
if kmip_version < enums.KMIPVersion.KMIP_1_3:<EOL><INDENT>raise exceptions.VersionNotSupported(<EOL>"<STR_LIT>".format(<EOL>kmip_version.value<EOL>)<EOL>)<EOL><DEDENT>local_buffer = BytearrayStream()<EOL>if self._rng_algorithm:<EOL><INDENT>self._rng_algorithm.write(local_buffer, kmip_version=kmip_version)<EOL><DEDENT>else:<EOL><INDENT>raise exceptions.InvalidField(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>if self._cryptographic_algorithm:<EOL><INDENT>self._cryptographic_algorithm.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>if self._cryptographic_length:<EOL><INDENT>self._cryptographic_length.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>if self._hashing_algorithm:<EOL><INDENT>self._hashing_algorithm.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>if self._drbg_algorithm:<EOL><INDENT>self._drbg_algorithm.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>if self._recommended_curve:<EOL><INDENT>self._recommended_curve.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>if self._fips186_variation:<EOL><INDENT>self._fips186_variation.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>if self._prediction_resistance:<EOL><INDENT>self._prediction_resistance.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>self.length = local_buffer.length()<EOL>super(RNGParameters, self).write(<EOL>output_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL>output_buffer.write(local_buffer.buffer)<EOL>
Write the RNGParameters structure encoding to the data stream.

Args:
    output_buffer (stream): A data stream in which to encode
        Attributes structure data, supporting a write method.
    kmip_version (enum): A KMIPVersion enumeration defining the KMIP
        version with which the object will be encoded. Optional,
        defaults to KMIP 2.0.

Raises:
    InvalidField: Raised if the RNG algorithm field is not defined.
    VersionNotSupported: Raised when a KMIP version is provided that
        does not support the RNGParameters structure.