AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
``` 从文件中读取字节 ``` ### 构造方法 ``` FileInputStream(File file) File对象 FileInputStream(String name) 文件路径名 ``` ### 方法 read ``` FileInputStream fs = new FileInputStream("test.txt"); byte[] b = new byte[2]; int len; while ((len = fs.read(b)) != -1){ System.out.println(new String(b)); } fs.close(); ```