public static void main(String[] args) throws IOException {
copyTxtDemo();
}
public static void copyTxtDemo() throws IOException {
//创建缓冲区对象。
FileInputStream fis = new FileInputStream("C:\\Users\\Administrator\\Desktop\\API.CHM");
FileOutputStream fos = new FileOutputStream("C:\\Users\\Administrator\\Desktop\\A.CHM");
BufferedInputStream fils = new BufferedInputStream(fis);
BufferedOutputStream fosl = new BufferedOutputStream(fos);
byte[] by = new byte[1024];
int len = 0;
while((len=fils.read(by))!=-1){
fosl.write(by,0,len);
fosl.flush();
}
fis.close();
fos.close();
}