We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31abd68 commit efbc43aCopy full SHA for efbc43a
src/clj_http/util.clj
@@ -57,10 +57,11 @@
57
(.toByteArray baos))))
58
59
(defn force-byte-array
60
- "force b as byte array if it is an InputStream."
+ "force b as byte array if it is an InputStream, also close the stream"
61
[b]
62
(if (instance? java.io.InputStream b)
63
- (IOUtils/toByteArray ^java.io.InputStream b)
+ (try (IOUtils/toByteArray ^java.io.InputStream b)
64
+ (finally (.close ^java.io.InputStream b)))
65
b))
66
67
(defn inflate
0 commit comments