• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to transform a OutputStream in a InputStream?

 
Rafael Afonso
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You read a file with an InputStrean, and write to a file with an OutputStream.
What is it you want?
/Rene
 
Rafael Afonso
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my try:

/Rene
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic