public class InputStreamDemo1 {
public static void main(String[] args) throws IOException {
FileInputStream fileInputStream =new FileInputStream(new File("E:\\a.txt"));
byte[] buf =new byte[1024];
int length =0;
while((length=fileInputStream.read(buf))!=-1){
System.out.println(new String(buf,0,length));
}
fileInputStream.close();
}
}
|
|