标签:keyword ble containe lsp word order ati roc main
| importjava.io.File; importjava.io.FileInputStream; importjava.io.FileOutputStream; importjava.io.IOException;   publicclassdemo6 {      /**      * 把一张图片拷贝到指定的位置      *       */    publicstaticvoidmain(String[] args) throwsIOException {         //拿到图片的路径         File file = newFile("C:\\Users\\PC-LUO\\Desktop\\新建文件夹\\98.jpg");         //创建拷贝后的路径         File file2 = newFile("C:\\Users\\PC-LUO\\Desktop\\4.jpg");                  image(file, file2);     }          //拷贝操作     publicstaticvoidimage(File file , File file2) throwsIOException{                  //输入流         FileInputStream inputStream = newFileInputStream(file);         //输出流         FileOutputStream outputStream = newFileOutputStream(file2);                  //创建缓冲区,大小为1K         byte[] b = newbyte[1024];                  //循环遍历文件内容,没有就返回-1         while(inputStream.read(b) != -1) {             //把得到的数据写入到指定位置             outputStream.write(b);           }         //关闭资源         outputStream.close();         inputStream.close();     }  } | 
标签:keyword ble containe lsp word order ati roc main
原文地址:http://www.cnblogs.com/zh-0802/p/6134703.html