      OutputStream
      InputStream
      PipedInputStream
-     PipedOutputStream]
+     PipedOutputStream
+     ByteArrayOutputStream]
     [java.security
      MessageDigest]
     [java.nio

  [x options]
  (InflaterInputStream. (bytes/to-input-stream x options)))

(defn- in->wrapped-out->in [^InputStream stream output-wrapper options]
  (let [chunk-size (get options :chunk-size 65536)
        out (PipedOutputStream.)
        in (PipedInputStream. out chunk-size)


(def-compressor lzo
  [x options]
  (bytes->wrapped-out->bytes
    x
    #(LzoOutputStream. %
       (-> (LzoLibrary/getInstance) (.newCompressor nil nil))
       (* 25 1024))
