2019独角兽企业重金招聘Python工程师标准>>>
public class copyFIle {
public static void main(String[] args) throws IOException {
File source = new File("d:/test/1.xml");File des = new File("d:/test/ma.txt");InputStream input =null;OutputStream out=new FileOutputStream(des,true);byte a[]=new byte[10];try {input = new FileInputStream(source);while((input.read(a))!=-1) {//容易出错String info=new String(a,0,10);System.out.println(info);byte data[]=info.getBytes();out.write(data);out.flush();}out.close();input.close();
} catch (FileNotFoundException e) {e.printStackTrace();
}
} }