• Post Reply Bookmark Topic Watch Topic
  • New Topic

convert the output stream to an input stream  RSS feed

 
sam patel
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
One quick question
I have an outputstream and i would like to convert to InputStream...
Any Help or sample code will be greatly appreciated....
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it sensible to take output data (e.g. export to a file) and turn it into an input stream (e.g. to bus it to another location within the application)? If an application has outputted the data, then it knows what the data is already! It would be more logical to do the reverse, surely (i.e. read a file in and output it to another location in the application)?
Still, if you could explain what the exact types of OutputStream and InputStream are, and perhaps a brief explanation of what exactly you are trying to achieve, then I may be able to construct a sample extract of code for you.
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the PipedOutputStream and PipedInputStream, they allow you to link up streams going in either direction.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!