java给txt文件写入内容原内容被覆盖怎么办?
(sResult="1111111111111";BufferedWriterbw=newBufferedWriter(newOutputStreamWriter(new...
(sResult="1111111111111";
BufferedWriter bw = new BufferedWriter (new OutputStreamWriter (new FileOutputStream ("content.txt"),"UTF-8"));
bw.write (sResult);
bw.close();
这个代码!! 要用 utf-8 格式存入 展开
BufferedWriter bw = new BufferedWriter (new OutputStreamWriter (new FileOutputStream ("content.txt"),"UTF-8"));
bw.write (sResult);
bw.close();
这个代码!! 要用 utf-8 格式存入 展开
1个回答
2015-02-27
展开全部
BufferedWriter bw = new BufferedWriter (new OutputStreamWriter (new FileOutputStream ("content.txt", true), "UTF-8"));
加true,表示追加
加true,表示追加
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询