aspose file tools*
The moose likes I/O and Streams and the fly likes Writing Readable Text to a File Using Streams Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Writing Readable Text to a File Using Streams" Watch "Writing Readable Text to a File Using Streams" New topic
Author

Writing Readable Text to a File Using Streams

Colin McGraw
Greenhorn

Joined: Jul 31, 2003
Posts: 2
I have a simple question about Java file i/o. I want to write strings to a file such that what is in the string is all that is written to the file.
I've been using an ObjectOutputStream.writeUTF()/writeChars(), but doing so writes size information before each string or character, and the size information appears as nonsense characters when you open the file.
What object/ method do I want to use instead?
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
Use a PrintWriter object and use println(). You can find the API here
 
 
subject: Writing Readable Text to a File Using Streams