复制JPG文件
/** 来自 时 代 J a v a**/ import java.io.*; public class CopyJPGFile { public static void main(String[] args) { try (FileInputStream source = new FileInputStream(new File("files/picture.jpg")); FileOutputStream destination = new FileOutputStream(new File("files/my-copied-picture.jpg"))){ byte[] buffer = new byte[4096]; while (true){ int readBytes = source.read(buffer,0,buffer.length); if(readBytes <= 0){ break; } else { destination.write(buffer,0,readBytes);/** 来 自 NowJava.com**/ } }