public ServerProcessing ProcessMessage(IServerChannelSinkStack sinkStack,
                                               IMessage requestMsg,
                                               ITransportHeaders requestHeaders,
                                               Stream requestStream,
                                               out IMessage responseMsg,
                                               out ITransportHeaders responseHeaders,
                                               out Stream responseStream)
        {
            // uncompressing the request
            requestStream =
                CompressionHelper.getUncompressedStreamCopy(requestStream);

            // pushing onto stack and forwarding the call
            sinkStack.Push(this, null);

            ServerProcessing srvProc = _nextSink.ProcessMessage(sinkStack,
                                                                requestMsg,
                                                                requestHeaders,
                                                                requestStream,
                                                                out responseMsg,
                                                                out responseHeaders,
                                                                out responseStream);

            // compressing the response
            responseStream =
                CompressionHelper.getCompressedStreamCopy(responseStream);

            // returning status information
            return(srvProc);
        }
        public void AsyncProcessResponse(IClientResponseChannelSinkStack sinkStack,
                                         object state,
                                         ITransportHeaders headers,
                                         Stream stream)
        {
            // deflate the response
            stream =
                CompressionHelper.getUncompressedStreamCopy(stream);

            // forward the request
            sinkStack.AsyncProcessResponse(headers, stream);
        }
        public void ProcessMessage(IMessage msg,
                                   ITransportHeaders requestHeaders,
                                   Stream requestStream,
                                   out ITransportHeaders responseHeaders,
                                   out Stream responseStream)
        {
            // generate a compressed stream using NZipLib

            requestStream =
                CompressionHelper.getCompressedStreamCopy(requestStream);

            // forward the call to the next sink
            _nextSink.ProcessMessage(msg,
                                     requestHeaders,
                                     requestStream,
                                     out responseHeaders,
                                     out responseStream);

            // deflate the response
            responseStream =
                CompressionHelper.getUncompressedStreamCopy(responseStream);
        }