'Encode the MessageList into the signed_message_list rdfvalue.'

def EncodeMessageList(self, message_list, signed_message_list):

    uncompressed_data = message_list.SerializeToString()
    signed_message_list.message_list = uncompressed_data
    compressed_data = zlib.compress(uncompressed_data)
    if (len(compressed_data) < len(uncompressed_data)):
        signed_message_list.compression = rdf_flows.SignedMessageList.CompressionType.ZCOMPRESSION
        signed_message_list.message_list = compressed_data
