看过论坛中的一篇帖子后再加上自己的理解
帖子地址:http://www.apkbus.com/forum.php?mod=viewthread&tid=124993&extra=page%3D1&page=1
先来看一段程序
import java.io.*;
public class InputStreamReadTest {
public void inputStreamRead1() throws IOException{
//F盘中的test.txt内容为:我爱你中国
InputStream is = new FileInputStream("F:\\test.txt");
OutputStream os = new FileOutputStream("F:\\ctest.txt");
int len = 0;
while((len=is.read())!=-1){
System.out.println("len="+len);
os.write(len);
}
is.close();
os.close();
}
public void inputStreamRead2() throws IOException{
InputStre