package com.tedu.day1201;
import java.io.File;
import java.io.FileOutputStream;
public class Study_Fos {
public static void main(String[] args) {
try {
// 创建FileOutputStream对象
// File file = new File("text.txt");
// FileOutputStream out = new FileOutputStream(file);
FileOutputStream out = new FileOutputStream("test.txt",true);
//调用write()方法进行写出
// 第一种写入方式
// out.write(65);
// out.write(66);
// out.write(67);
// out.write(68);
// 第二种写入方式
byte[] bs = {'a','b','c','d'};
out.write(bs);
out.write("12345".getBytes());
//释放资源
out.close();
} catch (Exception e) {
System.out.println("出现异常");
e.printStackTrace();
}
}
}