aspose file tools*
The moose likes I/O and Streams and the fly likes converting output to input Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "converting output to input" Watch "converting output to input" New topic
Author

converting output to input

Dan Murphy
Ranch Hand

Joined: Mar 29, 2005
Posts: 126
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


SCJP, SCJD, SCWCD
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19552
    
  16

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: converting output to input
 
Similar Threads
How To Download and Recreate GIF Images?
copy files
I am getting junk, when trying file copy
create an OutPutStreamObject with out using files and which supports chinese characters
File lock for Zip files in Java