>>>System.getProperty("line.separator")
>
> Ok.
> I will check out that method call.
> Thanks very much for the tip.
In addition, DataOutputStream is primarily intended for store and restore
operations, going round trip from live Java object, to file, back to live
Java object. The file written is not necessarily intended for external
consumption. The fact that you can open it in a text editor is
implementation dependent.
If you want to write strings to a readable text file, it might be better to
use something that gives you control of the output encoding, e.g., UTF-8,
ISO-5988, etc., using an OutputStreamWriter on a FileOutputStream.
Mike Schilling - 16 Apr 2007 07:26 GMT
>>>>System.getProperty("line.separator")
>>
[quoted text clipped - 11 lines]
> to use something that gives you control of the output encoding, e.g.,
> UTF-8, ISO-5988, etc., using an OutputStreamWriter on a FileOutputStream.
Or better yet a PrintWriter, which allows you to use println(), which will
figure out the proper line terminator for you.