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