java FileInputStream读取文件
java FileInputStream读取文件
public static void readFileData(String filePath) throws IOException { File classFile = new File(filePath); FileInputStream fis = new FileInputStream(classFile); byte[] bytes1 = new byte[1024]; int len=0; while((len=fis.read(bytes1))!=-1) { String s = new String(bytes1,0,len); System.out.println(s); } fis.close(); }
##############################
QQ 3087438119