标签:
import java.io.*; public class FileUtil { public static void copy(File src,File dest){ FileInputStream fis=null; FileOutputStream fos=null; try { byte[] bys = new byte[1024]; int size = -1; fis = new FileInputStream(src); fos = new FileOutputStream(dest); while((size=fis.read(bys))!=-1){ fos.write(bys); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally{ try { fis.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { fos.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }
标签:
原文地址:http://www.cnblogs.com/hzzhero/p/5107810.html