All Downloads are FREE. Search and download functionalities are using the official Maven repository.

holmos.webtest.basetools.file.MyWriter Maven / Gradle / Ivy

There is a newer version: 1.0.2u10
Show newest version
package holmos.webtest.basetools.file;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
/**
 * @author 吴银龙([email protected])
 * */
public class MyWriter {
	private BufferedWriter writer;
	public MyWriter(String filePath){
		try {
			BufferedWriter writerTemp=new BufferedWriter(new FileWriter(new File(filePath)));
			this.writer=writerTemp;
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	public void writeLine(String tab,String content){
		try {
			this.writer.write(tab+content+"\r\n");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	public void flush(){
		try {
			this.writer.flush();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	public void close(){
		try {
			this.writer.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy