<br class="markdown_return">阅读下列代码 <br class="markdown_return">I

分类: 高级Java开发工程师 发布时间: 2023-11-03 11:08 浏览量: 0


阅读下列代码
Import java.io.*;
Public class Example {
public static void main(String[] args)throws Exception {
File file = new File("itcast.txt");
FileInputStream in = new FileInputStream(file);
byte[] buff = new byte[1024]; // 定义一个字节数组,作为缓冲区
int len;
while ((len = in.________) != -1) { // 判断是否读到文件末尾
System.out.println(new String(buff,0,len));
}
in.close();
}
}
请说出下划线上,填写的方法名称( )
1分

A.read(buff)

B.read()

C.write(buff)

D.write()

正确答案是A