package zuoye;
import java.io.FileInputStream;
import java.io.FileOutputStream;
public class BinIoDemo {
public static void main(String[] args) {
FileInputStream in;
try {
in = new FileInputStream("d:/zuoye/1.doc");
byte[]b=new byte[1024];
int i=-1;
FileOutputStream out=new FileOutputStream("d:/zuoye/001张.doc");
while((i=in.read(b))>0)
{
out.write(b, 0, i);
}
out.close();
in.close();
}
catch (Exception e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
}
时间: 2024-10-06 23:36:48