This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes writing text file to outputstream Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "writing text file to outputstream" Watch "writing text file to outputstream" New topic
Author

writing text file to outputstream

Ankit Chandrawat
Ranch Hand

Joined: Jan 03, 2008
Posts: 78
Hi,

I have a text file that I want to read and write it to outputstream. For that I am using ByteArrayOutputStream. The text file should be read line by line and after each line a linebreak character should be inserted. How can I implement this. Also is there any other better way through which I can achieve the same. Attached is the image showing how it is being displayed now.

TIA,
Ankit Chandrawat


[Download view.bmp] Download

John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
Ankit:

Googling 'java io outputstream tutorial' will give you several examples.

John.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: writing text file to outputstream
 
Similar Threads
save a file, in a different subdirectory
Call to Servlet with InputStream from application
Reading second in a text file
how to read lines in BuffredReader
Reading the file