@classmethod
def write_buffer(cls):
    """Write buffer to file because buffer is full

        The buffer part is necessary because the GzipFile.write()
        method seems fairly slow.

        """
    assert cls.line_buffer and cls._fileobj
    cls.line_buffer.append(b'')
    cls._fileobj.write(cls._line_sep.join(cls.line_buffer))
    cls.line_buffer = []
