File input = new File("D:/MJ.xml");
File output = new File("D:/wangzhi.xml");
byte[] bs = new byte[1024];
// if(!output.isFile()){
// output.createNewFile();
// }
InputStream inputStream = input.toURL().openStream();
OutputStream outputStream = new FileOutputStream(output);
while(true){
int readCount = inputStream.read(bs);
if(readCount == -1){
break;
}
outputStream.write(bs, 0, readCount);
}
inputStream.close();
outputStream.close();