> Notice the “unreadable code” from C#, even the portability issue (hint: \n does not always do what you think it does).
No, it does exactly what you think it does (unless it is a binary stream), it adds an end-of-line to the stream. If the underlying platform needs a "\r\n", the stream will do the conversion.