           (do
             (.write baos (mk-trailer deflater crc))
             (.close baos)
-            (let [channel-buffer (ChannelBuffers/copiedBuffer (.toByteArray baos))]
-              channel-buffer)))))))
+            (ChannelBuffers/copiedBuffer (.toByteArray baos))))))))
 
 (defn- send-chunks
   [deflater downstream buf]
-  (println "GZIPPING CHUNKS")
   (let [buf-len (alength buf)]
     (loop []
       (let [compressed-bytes (.deflate deflater buf 0 buf-len)]
         (if-not (= 0 compressed-bytes)
           (let [channel-buffer (ChannelBuffers/copiedBuffer buf 0 compressed-bytes)]
-            (println "channel buffer: ")
-            (println (ChannelBuffers/hexDump channel-buffer))
             (downstream :body channel-buffer)
             (recur)))))))
 


(defn- gzip-entire-body
  [deflater crc body]
  (println "GZIPPING ENTIRE BODY")
  (let [baos (ByteArrayOutputStream.)
        buf (byte-array 4092)
        bytes (body->byte-array body)]

      (downstream :body (ChannelBuffers/wrappedBuffer (mk-trailer deflater crc)))
      (downstream :body nil))))

(def default-opts {:gzip-content-types #{"text/plain"
                                         "text/html"
                                         "text/xhtml"
                                         "text/javascript"
                                         "application/javascript"
                                         "text/css"}})

(defn encoder
  ([app] (encoder app default-opts))
