public class InputStreamTest {
public static void main(String[] args) throws IOException {
/**
* 字节流
* 读文件内容
* */
String st="d:"+File.separator+"java8.txt";
File f=new File(st);
InputStream is=new FileInputStream(f);
byte[] b=new byte[1024];
is.read(b);
is.close();
System.out.println(new String(b));
}
System.out.println(new String(b));这句代码怎么理解
时间: 2024-11-03 21:06:53