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(); }
##############################
标签:java,String,bytes1,len,new,FileInputStream,读取 From: https://www.cnblogs.com/herd/p/16260777.html