FileInputStream fis=new FileInputStream("C:/atlog.txt");
//在创建高层流时将低层流通过构造子传到高层流中
BufferedInputStream bis=new BufferedInputStream(fis);
byte bytes[]=new byte[1024*1024];//相当于1M
int result=bis.read(bytes);
while(result!=-1)
{
String temp=new String(bytes,0,result);
System.out.print(temp);
result=bis.read(bytes);
}是这个样子?
System.out.print(tmp);
这句是将结果送往控制台输出吧,问题的重点就是如何将BufferInputStream或者BufferReader中的数据直接送往打印机,我估计依靠纯JAVA代码不行,可能是要调用WINDOWS的API,但是对API调用非常陌生,因此想请教论坛的各位朋友