1.OutputStream写入文件内容
import java.io.*;
public class OutPutStreamDemo01 {
public static void main(String[] args) throws Exception {
//第1步:应用File类找到一个文件
File f = new File(File.separator + "Users/QiuFeihu/Work/test/hello.txt");
f.createNewFile();
//第2步:通过子类实例化父类对象
OutputStream out = null; //预备好一个输出的对象
out = new FileOutputStream(f); //通过对象多态性,进行实例化
//第3步:进行写操作
String str = "Hello World!!!"; //预备一个字符串
byte b[] = str.getBytes(); //只能输出byte数组,所以将字符串变成byte数组
out.write(b);
//第4步:关闭输出流
out.close();
}
}import java.io.*;
public