?? uploadfilewriter.java
字號:
/*
* Created on 2005-6-16
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package org.ug.sztz.domain.upload;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
/**
* @author xix
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class UploadFileWriter {
private InputStream in;
private String outPath;
/**
*
*/
public UploadFileWriter() {
// TODO Auto-generated constructor stub
}
public UploadFileWriter(InputStream in, String outPath){
this.in = in;
this.outPath = outPath;
}
public void save() throws Exception{
OutputStream bos = new FileOutputStream(outPath);
int bytesRead = 0;
byte[] buffer = new byte[8192];
while ((bytesRead = in.read(buffer, 0, 8192)) != -1) {
bos.write(buffer, 0, bytesRead);
}
bos.close();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -