Esempio n. 1
0
        public void SendZippedResponse(HttpListenerResponse response, ByteResponseData data)
        {
            response.AddHeader("Content-Encoding", "gzip");
            response.ContentType = data.ContentType.GetValue();
            byte[] buffer = data.Content;
            using (MemoryStream ms = new MemoryStream())
            {
                using (GZipStream zip = new GZipStream(ms, CompressionMode.Compress))
                {
                    zip.Write(buffer, 0, buffer.Length);
                }
                buffer = ms.ToArray();
            }

            WriteAndFlushResponse(response, buffer);
        }
Esempio n. 2
0
        public void SendZippedResponse(HttpListenerResponse response, ByteResponseData data)
        {
            response.AddHeader("Content-Encoding", "gzip");
            response.ContentType = data.ContentType.GetValue();
            byte[] buffer = data.Content;
            using (MemoryStream ms = new MemoryStream())
            {
                using (GZipStream zip = new GZipStream(ms, CompressionMode.Compress))
                {
                    zip.Write(buffer, 0, buffer.Length);
                }
                buffer = ms.ToArray();
            }

            WriteAndFlushResponse(response, buffer);
        }
Esempio n. 3
0
 public void SendResponse(HttpListenerResponse response, ByteResponseData data)
 {
     response.ContentType = data.ContentType.GetValue();
     byte[] buffer = data.Content;
     WriteAndFlushResponse(response, buffer);
 }
Esempio n. 4
0
 public void SendResponse(HttpListenerResponse response, ByteResponseData data)
 {
     response.ContentType = data.ContentType.GetValue();
     byte[] buffer = data.Content;
     WriteAndFlushResponse(response, buffer);
 }