Jan 17, 2007 - 05:50 AM
Depending on how you're creating the info that's going into the stream, there are a number of ways you can do it, including the one you've described in your question.
While it's certainly not the only option, I've grown fond of using a StringBuilder in a situation where I'm appending a bunch of stuff to write to a stream. To ensure linebreaks, I use the following code:
StringBuilder sb = new StringBuilder();
sb.Append("blah, blah, blah");
sb.Append("more blah, blah, blah");
That puts a correct "newline" into the string that gets written into the stream.
I hope this helps,
Feb 10, 2007 - 02:59 AM