日期:2014-05-18  浏览次数:20622 次

使java写入txt内容分段
private static void parse5(String ln32) throws IOException {
// TODO Auto-generated method stub
File f=new File("d:\\mldn.txt");
if(f.exists()){
f.delete();
f.createNewFile();
}
else{
f.createNewFile();
}
FileOutputStream fos=new FileOutputStream(f,true);
byte b[]=(ln32).getBytes();
try {
fos.write(b);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Java Parse String

------解决方案--------------------
报错。还是怎么着。
------解决方案--------------------
你将String ln32参数改成数组吧,在使用流换行。
------解决方案--------------------
你这是要干嘛呢?