change writeEvent signature to make set Content-Encoding and compress
more naturally