import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
public class InputStreamTest1
{
public static void main(String[] args) throws Exception
{
InputStream is = new FileInputStream("c:/hello.txt");
byte[] buffer = new byte[200];
int length = 0; //实际读了多少长度
while(-1 != (length = is.read(buffer,0,200))) //字节输入流的read方法
{
String str = new String(buffer,0,length);
System.out.println(str);
}
is.close();
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)