function | since v1.10.126 | Edit |
(gzip bytes)
(defn ^bytes gzip [^bytes bytes]
(let [baos (ByteArrayOutputStream. (count bytes))]
(try
(let [gzos (GZIPOutputStream. baos)]
(try
(.write gzos bytes)
(finally
(.close gzos))))
(finally
(.close baos)))
(.toByteArray baos)))