Re: writing bytes to a file

2009-01-08 Thread Brian Doyle
On Thu, Jan 8, 2009 at 12:36 PM, Brian Doyle wrote: > > > On Thu, Jan 8, 2009 at 11:34 AM, James Reeves > wrote: > >> >> On Jan 8, 5:05 pm, "Brian Doyle" wrote: >> > I incorporated most of James ideas but I don't like the name >> pipe-stream. >> >> Then wouldn't copy-stream be better? write-str

Re: writing bytes to a file

2009-01-08 Thread Brian Doyle
On Thu, Jan 8, 2009 at 11:34 AM, James Reeves wrote: > > On Jan 8, 5:05 pm, "Brian Doyle" wrote: > > I incorporated most of James ideas but I don't like the name pipe-stream. > > Then wouldn't copy-stream be better? write-stream isn't specific > enough, IMO. > Sure, write-stream works for me.

Re: writing bytes to a file

2009-01-08 Thread James Reeves
On Jan 8, 5:05 pm, "Brian Doyle" wrote: > I incorporated most of James ideas but I don't like the name pipe-stream. Then wouldn't copy-stream be better? write-stream isn't specific enough, IMO. Also, I don't think there's a huge amount of gain to be had from an Integer type hint in this case, s

Re: writing bytes to a file

2009-01-08 Thread Brian Doyle
I incorporated most of James ideas but I don't like the name pipe-stream. (defn write-stream "Writes the data from the istream to the ostream." ([#^java.io.InputStream istream #^java.io.OutputStream ostream #^Integer buffer-size] (let [buffer (make-array (Byte/TYPE) buffer-size)]

Re: writing bytes to a file

2009-01-08 Thread Randall R Schulz
On Thursday 08 January 2009 01:28, James Reeves wrote: > On Jan 7, 7:14 pm, "Brian Doyle" wrote: > >    (defn write-bytes > >      "Writes the bytes from the in-stream to the given filename." > >      [#^java.io.InputStream in-stream #^String filename] > >      (with-open [out-stream (new FileOut

Re: writing bytes to a file

2009-01-08 Thread James Reeves
On Jan 7, 7:14 pm, "Brian Doyle" wrote: >    (defn write-bytes >      "Writes the bytes from the in-stream to the given filename." >      [#^java.io.InputStream in-stream #^String filename] >      (with-open [out-stream (new FileOutputStream filename)] >        (let [buffer (make-array (Byte/TYPE

Re: writing bytes to a file

2009-01-07 Thread Brian Doyle
Looks like spit is for printing just text. On Wed, Jan 7, 2009 at 12:20 PM, Paul Barry wrote: > clojure.contrib.duck_streams/spit? > > > On Wed, Jan 7, 2009 at 2:14 PM, Brian Doyle wrote: > >> I couldn't find anything in core or contrib that wrote out >> bytes to a file so I wrote something to

Re: writing bytes to a file

2009-01-07 Thread Paul Barry
clojure.contrib.duck_streams/spit? On Wed, Jan 7, 2009 at 2:14 PM, Brian Doyle wrote: > I couldn't find anything in core or contrib that wrote out > bytes to a file so I wrote something to do it. Is this > functionality already implemented and I just couldn't find > it? If there isn't anythi