public static byte[] getExceptionStack(Exception e){
if (null == e) {
return null;
}
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter(stringWriter);
e.printStackTrace(printWriter);
return stringWriter.toString().getBytes();
}