InputStream f = new FileInputStream("c:/java/hello");
1
b: 使用文件对象
File f = new File("c:/java/hello");
InputStream is = new FileInputStream(f);
1
2
得到对象之后,常用的方法有read(int t),从InputStream对象读取指定字节的数据,返回下一字节数据。若到末尾则返回***-1***;read(byte[] r),从***InputStream***读取***长度为r.length长度的字节***,返回读取的字节数。