首页 > 技术文章 > 输出流 写文件 文本 换行nextLine

mohe 2013-09-16 20:39 原文

 
FileOutputStream   fos   =   new   FileOutputStream( "c:\\test.txt "); 
String   nextLine   =   System.getProperty( "line.separator "); 
String   testStr   =   "abcd "+nextLine+ "efgh "+nextLine+ "igkl "
byte[]   c   =   testStr.getBytes(); 
fos.write(c); 
fos.close();

推荐阅读