File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

converting output to input

 
Dan Murphy
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What is the best way to convert either a Writer or an OutputStream to either a Reader or an InputStream? Just to be clear, what I`m looking for is the most efficient way to do *any one* of the following (not *all* of them):

- OutputStream => Reader
- OutputStream => InputStream
- Writer => Reader
- Writer => InputStream

Thanks in advance,
Don
 
Rob Spoor
Sheriff
Pie
Posts: 20396
47
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean that one class writes to the writer, and another class reads from the reader, and the writer and reader are linked?

That's just what PipedReader + PipedWriter or PipedInputStream / PipedOutputStream are for.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic