| Author |
Outputfiles to an outputStream in their Original text format
|
Stanley Mungai
Ranch Hand
Joined: Dec 09, 2011
Posts: 91
|
|
The code I have here Outputs these text files into Pdf Files because I have used a PdfWriter. Is there a way of Using A BufferedWriter to Output these Files by their Original text Format? Here is the code am using:
The Input Directory C:/Temporary Contains Text files. I need the to be Output into C:/Statements directory In their Original text format. Please Help.
|
Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
|
 |
Jeff Verdegan
Bartender
Joined: Jan 03, 2004
Posts: 3143
|
|
Stanley Mungai wrote:The code I have here Outputs these text files into Pdf Files because I have used a PdfWriter.
Given this...
Is there a way of Using A BufferedWriter to Output these Files by their Original text Format?
...I would think the answer to this would be obvious.
|
 |
Stanley Mungai
Ranch Hand
Joined: Dec 09, 2011
Posts: 91
|
|
|
Jeff, it is not obvious, I want to know how to connect a Buffered Writer (then) with an outputStream.
|
 |
Jeff Verdegan
Bartender
Joined: Jan 03, 2004
Posts: 3143
|
|
Stanley Mungai wrote:Jeff, it is not obvious, I want to know how to connect a Buffered Writer (then) with an outputStream.
If it were me, and I were just copying a file, any old file, I wouldn't use readers and writers at all. I'd just use FileInputStream and FileOutputStream. If I wanted specifically to copy a text file, there would also be the option of using FileReader and FileWriter, wrapped in BufferedReader and BufferedWriter.
If I had to connect a BufferedWriter with an OutputStream (which isn't really necessary here), I'd use an OuputStreamWriter in the middle.
|
 |
Stanley Mungai
Ranch Hand
Joined: Dec 09, 2011
Posts: 91
|
|
Yep, That OutputStreamWriter Works pretty fine with my Situation something like:
|
 |
Stanley Mungai
Ranch Hand
Joined: Dec 09, 2011
Posts: 91
|
|
Thank you.
|
 |
Jeff Verdegan
Bartender
Joined: Jan 03, 2004
Posts: 3143
|
|
You're welcome!
And welcome to the Ranch!
|
 |
 |
|
|
subject: Outputfiles to an outputStream in their Original text format
|
|
|