• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem using InputStream converted from OutputStream

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic