Carriage Return\Line feed in Java

后端 未结 6 912
滥情空心
滥情空心 2020-12-12 21:46

I have created a text file in Unix environment using Java code.

For writing the text file I am using java.io.FileWriter and BufferedWriter.

6条回答
  •  离开以前
    2020-12-12 22:42

    The method newLine() ensures a platform-compatible new line is added (0Dh 0Ah for DOS, 0Dh for older Macs, 0Ah for Unix/Linux). Java has no way of knowing on which platform you are going to send the text. This conversion should be taken care of by the mail sending entities.

提交回复
热议问题