예제 #1
0
 static Action<HttpListenerContext> DeflateEchoValue(string value)
 {
     return context =>
     {
         context.Response.Headers.Add("Content-encoding", "deflate");
         using(var gzip = new DeflateStream(context.Response.OutputStream, CompressionMode.Compress, true))
         {
             gzip.WriteStringUtf8(value);
         }
     };
 }