config-servlet/src/main/java/org/ocpsoft/rewrite/servlet/config/Response.java
public static OperationBuilder withOutputStreamWrappedBy(final ResponseStreamWrapper... wrappers)
            throws IllegalStateException
   {
      return new Response() {
         @Override
         public void performHttp(HttpServletRewrite event, EvaluationContext context)
         {
            for (ResponseStreamWrapper wrapper : wrappers) {
               RewriteWrappedResponse.getCurrentInstance(event.getRequest()).addStreamWrapper(wrapper);
            }
         }

         @Override
         public String toString()
         {
            return "Response.withOutputStreamWrappedBy(" + Strings.join(Arrays.asList(wrappers), ", ") + ")";
         }
      };
   }
public static OperationBuilder withOutputStreamWrappedBy(final ResponseStreamWrapper... wrappers)
            throws IllegalStateException
   {
      return new Response() {
         @Override
         public void performHttp(HttpServletRewrite event, EvaluationContext context)
         {
            for (ResponseStreamWrapper wrapper : wrappers) {
               RewriteWrappedResponse.getCurrentInstance(event.getRequest()).addStreamWrapper(wrapper);
            }
         }

         @Override
         public String toString()
         {
            return "Response.withOutputStreamWrappedBy(" + Strings.join(Arrays.asList(wrappers), ", ") + ")";
         }
      };
   }
Create an {@link Operation} that adds the given {@link ResponseStreamWrapper} instances to the current
{@link ServletResponse}. This will activate response stream wrapping on the current {@link ServletRequest} -
meaning response content will be piped through all registered {@link ResponseStreamWrapper} instances as it is
written to the client {@link ServletOutputStream}.

@throws IllegalStateException When output has already been written to the client.