zoukankan      html  css  js  c++  java
  • 0802作业2复制图片

    package com.jk.bean;
    
    import java.io.*;
    public class Test {
            public static void main(String[] args) {
                DataInputStream dis = null;
                DataOutputStream dos = null;
                FileInputStream fis = null;
                FileOutputStream fos = null;
                
                try{
                    //创建输入流对象
                    fis = new FileInputStream("c:\myDoc\star.jpg");
                    dis = new DataInputStream(fis);
                    //创建输出流 对象
                    fos = new FileOutputStream("c:\myDoc\new.jpg");
                    dos = new DataOutputStream(fos);
                    //读取文件并写入文件
                    int temp;
                    while((temp = dis.read())!=-1){
                        dos.write(temp);
                    }
                }catch (FileNotFoundException e){
                    e.printStackTrace();
                }catch (IOException e){
                    e.printStackTrace();
                }finally{
                    try{
                        if(dis!= null){
                            dis.close();
                        }
                        if(dos!=null){
                            dos.close();
                        }
                        if(fis!=null){
                            fis.close();
                        }
                        if(fos!=null){
                            fos.close();
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
                
            }
    }
  • 相关阅读:
    图像修补
    图像的矩
    使用多边形将轮廓包围
    寻找物体的凸包
    查找并绘制轮廓
    重映射
    霍夫变换
    边缘检测
    第二周神经网络基础
    第一周:深度学习引言(Introduction to Deep Learning)
  • 原文地址:https://www.cnblogs.com/jingkai555/p/11287867.html
Copyright © 2011-2022 走看看