📄 ascendingphoto.java
字号:
package com.jc.taobao.gjj.logic;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class AscendingPhoto {
public void IOImage(String clientpath,String servicepath)
{
File old = new File(clientpath);
File newImage = new File(servicepath);
FileInputStream fis = null;
FileOutputStream fos = null;
try {
if (!old.exists()) {
return;
} else {
fis = new FileInputStream(old);
if(!newImage.exists() ){
newImage.createNewFile();
}
fos = new FileOutputStream(newImage+"/"+ old.getName());
byte[] temp = new byte[1000];
int size = fis.read(temp);
while (size != -1) {
fos.write(temp);
size = fis.read(temp);
}
return ;
}
} catch (FileNotFoundException fileNot) {
fileNot.printStackTrace();
return;
}
catch(IOException e){
e.printStackTrace();
return;
}
finally{
try{
fis.close();
fos.close();
}catch(Exception ex){}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -