public void WriteBytes(byte[] bytes, bool isCompressed)
{
var response = context.Response;
response.AppendHeader("Content-Length", bytes.Length.ToString());
response.ContentType = this.contentType;
if (isCompressed)
response.AppendHeader("Content-Encoding", "gzip");
else
response.AppendHeader("Content-Encoding", "utf-8");
response.ContentEncoding = Encoding.Unicode;
response.OutputStream.Write(bytes, 0, bytes.Length);
response.Flush();
}