'Initialize a new renderer.
@param id: the message id
@type id: int
@param flags: the DNS message flags
@type flags: int
@param max_size: the maximum message size; the default is 65535.
If rendering results in a message greater than I{max_size},
then L{dns.exception.TooBig} will be raised.
@type max_size: int
@param origin: the origin to use when rendering relative names
@type origin: dns.name.Name or None.'

def __init__(self, id=None, flags=0, max_size=65535, origin=None):

    self.output = BytesIO()
    if (id is None):
        self.id = random.randint(0, 65535)
    else:
        self.id = id
    self.flags = flags
    self.max_size = max_size
    self.origin = origin
    self.compress = {}
    self.section = QUESTION
    self.counts = [0, 0, 0, 0]
    self.output.write(('\x00' * 12))
    self.mac = ''
