th+"/"+ tempList[i]);//再删除空文件夹Р }Р }Р }Р}Р5.编写一个读文件程序,它能够读二进制文件、文本文件等。要求最少以两种读文件方法实现,如按字符读取、按字节读取、随机读取、按行读取等方法。РРimport java.io.FileInputStream;Рimport java.io.FileNotFoundException;Рimport java.io.IOException;Рimport java.io.RandomAccessFile;РРРpublic class pile {Рpublic static void main(String args[]) throws IOException{Р?RandomAccessFile raf=new RandomAccessFile("random.text","rw");Рraf.writeBoolean(true);Рraf.writeInt(168168);Рraf.writeDouble(168.168);Рraf.seek(1);РSystem.out.println(raf.readInt());РSystem.out.println(raf.readChar());РSystem.out.println(raf.readDouble());Рraf.seek(0);РSystem.out.println(raf.readBoolean());Рraf.close();РFileInputStream fin=null;Рfin=new FileInputStream("D:/random.text");Рwhile((int i=fin.read())!=-1)Р{Р?System.out.print((char)i);Р?i=fin.read();