java io流

学习io流之前,先要了解File类。

  File类:代表文件和文件夹的抽象路径表示。

构造函数

  new File(String pathname);

  new File(String parent,String child);

  new File(File parent,String child);

IO:顶级抽象父类:InputStream     字节输入流、读取文件时需先关联源文件 new File();

            FileInputStream;

            FilterInputStream;

                BufferedInputStream;     BufferedInputStream bis = new BufferedInputStream(new FileInputStream("E:\test\1.txt");

             OutputStream   字节输出流、写出文件时需先关联目标文件 new File();

            FileOutputStream;

            FilterOutputStream;

                BufferedOutputStream;   BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("E:\test\1.txt");

原文地址:https://www.cnblogs.com/hpp0716/p/6588358.html