Basics.java :  » IDE » tIDE » snow » Java Open Source

Java Open Source » IDE » tIDE 
tIDE » snow » Basics.java
package snow;

import java.io.PrintWriter;
import java.io.StringWriter;

/** Some basic routines.
*/
public final class Basics
{

  private Basics()
  {
  }

  public static void ignore(Exception e)
  { //nopmd
  }

  public static String exceptionToString(Throwable t)
  {
     StringWriter sb = new StringWriter();
     PrintWriter pw = new PrintWriter(sb);
     t.printStackTrace(pw);
     pw.flush();
     return sb.toString();
  }

  public static void main(String[] arguments)
  {
     System.out.println(""+exceptionToString(new Throwable()));
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.