On Dec 16, 2:01 am, Trevor <tcr1...@gmail.com> wrote:
> I have created an output  stream, which appears to work fine, however
> I get an error when trying to convert the output stream into an input
> stream for use in ring:
>
> ('use [clojure.java.io :only [input-stream]])
>
> => (with-out-str (ofn var))
> "it works!"
>
> Now when I use ring:
> {:body (input-stream (ofn var))}
>
> java.lang.IllegalArgumentException: No implementation of method: :make-
> input-stream of protocol: #'clojure.java.io/IOFactory found for class:
> nil
>
> Is there something special I need to do to convert output stream into
> an input stream ?

You can probably consider PipedOutputStream and PipedInputStream:
http://docs.oracle.com/javase/6/docs/api/java/io/PipedOutputStream.html
http://docs.oracle.com/javase/6/docs/api/java/io/PipedInputStream.html

A Java example is here (section "Using Piped Streams"):
http://www.cs.princeton.edu/courses/archive/spr96/cs333/java/tutorial/java/io/streampairs.html


Regards,
Shantanu

-- 
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

Reply via email to