读文件字节流大小的动态设置

 File f = new File("E:"+File.separator+"java2"+File.separator+"StreamDemo"+File.separator+"test.txt");   
        InputStream in = new FileInputStream(f);   
        byte b[]=new byte[(int)f.length()];     //创建合适文件大小的数组   
        in.read(b);    //读取文件中的内容到b[]数组   
        in.close();   
        System.out.println(new String(b));
原文地址:https://www.cnblogs.com/simpledev/p/5746426.html