/**
* 测试类, FileOutputStream
* @author Administrator
*
*/
public class Test4 {
public static void main(String[] args) {
try {
//创建IO流对象
//覆盖原来的内容
// OutputStream os = new FileOutputStream("file/demo.txt");
//内容接着原来的内容写
OutputStream os = new FileOutputStream("file/demo.txt", true);
//向文件写入数据
// os.write(98);
os.write("hello java!!!".getBytes());
//关闭IO资源
os.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}