Code example for StringWriter

Methods: close, toString

0
		public String stackTraceToString(Throwable e) {
			String retValue = null;
			StringWriter sw = null;
			PrintWriter pw = null;
			try { 
			 sw = new StringWriter();
			 pw = new PrintWriter(sw);
			 e.printStackTrace(pw);
			 retValue = sw.toString();
			} finally { 
			 try { 
			   if(pw != null)  pw.close();
			   if(sw != null)  sw.close();
			 } catch (IOException ignore) {}
			} 
			return retValue;
			} 
	} 
	private class UpdateDataTaskHelper 
	{ 
		public DataEngine engine;