package com.gg.demo;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
public class Demo {
public static void main(String[] args) throws Exception {
//创建一个文件
//默认就是覆盖不是追加
//两个参数的构造器就是追加
//不但有些的功能 而且涵盖了创建文件的功能。没有就创建 有 打开
OutputStream os= new FileOutputStream("student.txt",true);
String bu="dvvdfvfddv";
//具体的写的操作
os.write(bu.getBytes());
//关闭
os.close();
System.out.println("ok....");
}
}
IO流知识点(1)OutputStream
最新推荐文章于 2022-08-03 22:52:21 发布