'Inplace compress out-buffer. Read/write position is moved to 0.'

def _zip(self):

    data = self.out_buffer.read()
    self.out_buffer = io.BytesIO()
    gz = gzip.GzipFile(fileobj=self.out_buffer, mode='wb', compresslevel=6)
    gz.write(data)
    gz.close()
    self.out_buffer.seek(0)
