     ChannelBuffers]))
 
 (def header-length (alength GzipUtils/header))
+(def trailer-length 8)
 
 (defn body->byte-array
   [body]


(defn- mk-trailer
  [deflater crc]
  (let [buf (byte-array 8)]
    (GzipUtils/writeTrailer deflater crc buf 0)
    buf))

(defn- gzip-entire-body
  [deflater crc body]
  (let [baos (ByteArrayOutputStream.)
        buf (byte-array 4092)
        bytes (body->byte-array body)]
    ;; write header

      (downstream :body (ChannelBuffers/wrappedBuffer GzipUtils/header)))

    ;; send the chunks
    (send-chunks deflater downstream buf)

    ;; send the trailer if needed
    (when (nil? chunk)
