wood burning stoves 2.0*
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Writing Readable Text to a File Using Streams
 
Similar Threads
what's difference between the new assignment and the old one?
JAD File size
windows file sizes
writing to file from Vector
How to retain decimal precisions after converting from String to double