如何在Java FileOutputStream中编写新行

编程入门 行业动态 更新时间:2024-10-25 10:31:07
本文介绍了如何在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中编写新行

本文发布于:2023-11-22 20:13:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1618847.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   Java   FileOutputStream

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!