File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes How to transform a OutputStream in a InputStream? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to transform a OutputStream in a InputStream?" Watch "How to transform a OutputStream in a InputStream?" New topic
Author

How to transform a OutputStream in a InputStream?

Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63
Hi,
I need put the contents of a OutputStream in a File. I know how transfer the contents of a InputStream to a File. So, (I think) I need transform a OutputStream in a InputStream. How do I do it?
Thanks,
Rafael U. C. Afonso


=================================<br /> Rafael U. C. Afonso<br /> <a href="http://www.javafree.com.br" target="_blank" rel="nofollow">www.javafree.com.br</a><br />=================================<br /><i>Where is debug?<br />debug is on the table</i>
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

You read a file with an InputStrean, and write to a file with an OutputStream.
What is it you want?
/Rene


Regards, Rene Larsen
Dropbox Invite
Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63
I am using a API to XSL transforms. It's FOP from Apache and I'm using Driver class. This class uses a OutputStream to stores the XSL transform. But I want to use this stream to store in a file.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
There's a document here which should help. You get to choose the type of OutputStream which you provide to the Driver. If you want to write to a file, create a FileOutputStream, and pass it to the Driver.


"I'm not back." - Bill Harding, Twister
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Also, please take a look at our display name policy and change your name to include a first and last name. Thanks.
Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63
Hi again,
I find a solution but I'm not 100% with this.

If anyone has had o better idea than mine, please say me.
Thanks
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

This is my try:

/Rene
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to transform a OutputStream in a InputStream?