def toStr(self):
        """
        Encode this L{Message} into a byte string in the format described by RFC
        1035.

        @rtype: L{bytes}
        """
        strio = BytesIO()
        self.encode(strio)
        return strio.getvalue()

        Encode this L{Message} into a byte string in the format described by RFC
        1035.

        @rtype: L{bytes}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/dns.py