Here you can find the source of serializeStackTrace(Throwable th)
Parameter | Description |
---|---|
th | a parameter |
public static String serializeStackTrace(Throwable th)
//package com.java2s; import java.io.ByteArrayOutputStream; import java.io.PrintWriter; public class Main { /**/*from ww w . j a v a2 s . c o m*/ * Gets a string representation of a stack trace. * * @param th * @return */ public static String serializeStackTrace(Throwable th) { ByteArrayOutputStream bout = new ByteArrayOutputStream(); PrintWriter pw = new PrintWriter(bout); th.printStackTrace(pw); pw.close(); return bout.toString(); } }