This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes problem using InputStream converted from OutputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "problem using InputStream converted from OutputStream" Watch "problem using InputStream converted from OutputStream" New topic
Author

problem using InputStream converted from OutputStream

Richard Adrian
Greenhorn

Joined: Jun 04, 2010
Posts: 3
I am trying to convert an outputstream to an inputstream in order to construct a StreamSource and came across this article.
http://ostermiller.org/convert_java_outputstream_inputstream.html

My memory requirements eliminate using the byte array or temp file methods mentioned.

I need to create the StreamSource and pass it to another method, so I can't read from the inputstream while the outputstream is being written to. Since I need a buffer all approach, i believe this eliminates the piped streams.

I tried using JBoss' growable pipe streams and the circular buffer, using a join in order to wait until the thread writing to the outputstream completed and then did a flush. I also tried the single threaded circular buffer example.

However when I call the method after passing in the StreamSource constructed with the input stream the application hangs.

Any ideas?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem using InputStream converted from OutputStream
 
Similar Threads
bulk batch jax-ws web services and memory usage
OutputStream -> InputStream
Converting outputstream to inputstream
obtaining InputStream/Reader from OutputStream/Writer to read the content
Piped Input to Output