⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uploadfilewriter.java

📁 基于JAVA的学生就业信息网 实现对信息浏览 检索 审核 修改和删除
💻 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 + -