本文介绍了如何在Java FileOutputStream中编写新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用 FileOutputStream 写一个新行;我尝试了以下方法,但它们都没有工作:
I want to write a new line using a FileOutputStream; I have tried the following approaches, but none of them are working:
encfileout.write('\n'); encfileout.write("\n".getbytes()); encfileout.write(System.getProperty("line.separator").getBytes());推荐答案
这可能是观众问题...尝试打开EditPlus或Notepad ++中的文件。 Windows记事本可能无法识别其他操作系统的换行符。您现在在哪个程序中查看该文件?
It could be a viewer problem... Try opening the file in EditPlus or Notepad++. Windows Notepad may not recognise line feed of another operating system. In which program are you viewing the file now?
更多推荐
如何在Java FileOutputStream中编写新行
发布评论