try { this.writer.close();    if (append && this.outFile != null) { Reader fileIn = null; try { fileIn = new InputStreamReader(new FileInputStream(this.outFile.getAbsolutePath()), "UTF-8"); copyReader(fileIn,newWriter); } catch (IOException e) { e.printStackTrace(); } finally { if (fileIn != null) { try { fileIn.close(); } catch (IOException e) { e.printStackTrace(); }
if (this.writer != null) { try { this.writer.close(); } catch (IOException e) { e.printStackTrace(); } this.writer = null; }    File oldOutFile = this.outFile; this.outFile = newOutFile; this.writer = newWriter; if (append && !newSession && oldOutFile != null) { Reader fileIn = null; try { openFile(); fileIn = new InputStreamReader(new FileInputStream( oldOutFile.getAbsolutePath()), "UTF-8"); copyReader(fileIn, this.writer); } catch (IOException e) { e.printStackTrace(); } finally { if (fileIn != null) { try { fileIn.close(); } catch (IOException e) { e.printStackTrace();
	private void setOutput(File newOutFile, Writer newWriter, boolean append) {		if (newOutFile == null || !newOutFile.equals(this.outFile)) {			try {				this.writer.close();				// append old outFile to newOut.  We only attempt to do this				// if the current Writer is backed by a File.				if (append && this.outFile != null) {					Reader fileIn = null;					try {						fileIn =							new InputStreamReader(new FileInputStream(this.outFile.getAbsolutePath()), "UTF-8");						copyReader(fileIn,newWriter);					} catch (IOException e) {						e.printStackTrace();					}					finally {						if (fileIn != null) {							try {								fileIn.close();							} catch (IOException e) {								e.printStackTrace();							}						}					}				}			} catch (IOException e) {				e.printStackTrace();			}			this.writer = newWriter;			this.outFile = newOutFile;		}	}