您的位置:首页 > 编程语言 > Java开发

java向txt文件中写入数据时换行

2012-12-07 12:48 676 查看
FileOutputStream fos = new FileOutputStream(filePath);

/**txt中换行*/

byte[] c = new byte[2];

c[0]=0x0d;

c[1]=0x0a;

String c_string = new String(c);

for(int i=0; i<notFoundList.size(); i++){

fos.write((notFoundList.get(i).toString()+c_string).getBytes());

}

if(fos != null){

fos.close();

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: