'Converts the object back into an HTTP header.'

def to_header(self):

    ranges = []
    for (begin, end) in self.ranges:
        if (end is None):
            ranges.append((((begin >= 0) and ('%s-' % begin)) or str(begin)))
        else:
            ranges.append(('%s-%s' % (begin, (end - 1))))
    return ('%s=%s' % (self.units, ','.join(ranges)))
