def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
tstream = BytearrayStream()<EOL>self.revocation_code.write(tstream, kmip_version=kmip_version)<EOL>if self.revocation_message is not None:<EOL><INDENT>self.revocation_message.write(tstream, kmip_version=kmip_version)<EOL><DEDENT>self.length = tstream.length()<EOL>super(RevocationReason, self).write(ostream, kmip_version=kmip_version)<EOL>ostream.write(tstream.buffer)<EOL>
Write the data encoding the RevocationReason object to a stream.

Args:
    ostream (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.