1.File类:对硬盘上的文件和目录进行操作的类. File类是文件和目录路径名抽象表现形式 构造函数: 1) File(String pathname) Creates a new File instance by converting the given pathname string into an abstract pathname. 2)File(File parent, String child) Creates a new File i
序:IO流的操作主要分为两种读和写.一方面:我们可以通过不加缓冲类字符流BufferedReader/Writer和字节流BufferedInputStream/OutputStream来进行简单的读写,当然加了缓冲类其效率更高.另一方面:当我们需要进行流转换时,主要为了解决读取乱码问题,且字节流能够进行编码指定,因此需要字节流到字符流的转换. 1.字符流的读写+不加BufferedReader/Writer public class CharIOTest { /** * 流转换读取数据. *
1.File类:对硬盘上的文件和目录进行操作的类. File类是文件和目录路径名抽象表现形式 构造函数: 1) File(String pathname) Creates a new File instance by converting the given pathname string into an abstract pathname. 2)File(File parent, String child) Creates a new File i