dcsimg
How to write data in the form of String to a file?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jojo_Angie
Posted On:   Monday, October 29, 2001 10:03 PM

I have a java socket application where I'll be receiving *.txt file from
the server. The input stream from the socket is ObjectInputStream. So, I cast
it to String when i read from the stream. Then, I wanna write this
stream to another file. But, so far from the tutorial about write to file,
the data is in int type. So, how can I do so that I can write String to
a file?Please help.

Re: How to write data in the form of String to a file?

Posted By:   John_Zukowski  
Posted On:   Tuesday, October 30, 2001 05:59 PM

Casting to a String is wrong. Reading from an ObjectInputStream properly is already covered in the FAQ. Just write the data to a FileWriter.
About | Sitemap | Contact