Created
August 7, 2017 10:19
-
-
Save RutledgePaulV/13cf085b05968f964a2442453dae1cc2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn zip-entries [^ZipInputStream input] | |
(let [last (atom nil)] | |
(letfn [(inner [stream] | |
(lazy-seq | |
(let [previous @last] | |
(when previous (.closeEntry stream)) | |
(if-some [entry (.getNextEntry stream)] | |
(cons (reset! last entry) (inner stream)) | |
(.close stream)))))] | |
(inner input)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment