Hi,

I want a function that takes byte array in zip format and returns
sequence of included ZipEntrys.

I wrote zipentry-seq based on clojure.core/resultset-seq as below.

(entries) returns sequence of included ZipEntrys and many nils, so I
added ad-hoc filter at the last.

Please advice me to make it more better.

<pre>
(defn zipentry-seq
  [zip-byte-array]
  (let [zip-stream (ZipInputStream. (ByteArrayInputStream. zip-byte-
array))
        entries (fn thisfn []
                  (when (not= 0 (.available zip-stream))
                    (cons (.getNextEntry zip-stream) (lazy-seq
(thisfn)))))]
    (filter #(not (nil? %)) (entries))))
</pre>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to