public class Demo5_Copy {
//拷贝的代码
public static void main(String[] args) throws IOException {
FileInputStream fis = new FileInputStream("双元.jpg"); //创建文件输入流对象,关联致双元.jpg
BufferedInputStream bis = new BufferedInputStream(fis); //创建缓冲区对fis装饰
FileOutputStream fos = new FileOutputStream("copy.jpg"); //创建输出流对象,关联copy.jpg
BufferedOutputStream bos = new BufferedOutputStream(fos); //创建缓冲区对fos装饰
int b;
while((b = bis.read()) != -1) {
bos.write(b);
}