日期:2014-05-20 浏览次数:20772 次
import java.io.*;
public class Iojava {
public static void main(String[] args) throws Exception {
File f=new File("D:"+File.separator+"text.txt");
InputStream In=null;
In=new FileInputStream(f);
byte[] b=new byte[1024];
int temp=0;
int len=0;
while((temp=In.read())!=-1)
{
System.out.print("temp 的值为:"+temp);
len++;
System.out.println(" len的值为"+len);
}
In.close();
}}