(defn new-output-stream "Need to create a new output stream because calling .hasNext() on the iterator discards all data." [input-stream] (Streams/copy input-stream (ByteArrayOutputStream.) true) output-stream)