package cn.mldn.demo;
import java.io.*;
public class Test{
	public static void main(String[] args) throws IOException {
		//创建文件写入内容,如果再次执行不追加。
		//FileOutputStream fos=new FileOutputStream("info1.txt");
		//文件末尾追加内容
		FileOutputStream fos=new FileOutputStream("info1.txt",true);
		for(int x=0;x<3;x++){
			fos.write(("hello"+x).getBytes());
			fos.write("\r\n".getBytes());
		}
	}
}

  

相关文章: