/** 对象组转字符串 */ public static string objectsToString(object[] objs) { if (objs.Length == 0) { return(""); } if (objs.Length == 1) { if (objs[0] == null) { return("null"); } else { return(objs[0].ToString()); } } StringBuilder sb = StringBuilderPool.createForThread(); writeObjectsToStringBuilder(sb, objs); return(StringBuilderPool.releaseStrForThread(sb)); }
/// <summary> /// 抛错 /// </summary> public static void throwError(params object[] args) { StringBuilder sb = StringBuilderPool.createForThread(); StringUtils.writeObjectsToStringBuilder(sb, args); toThrowError(sb, null); }
private static String exceptionToString(string str, Exception e) { StringBuilder sb = StringBuilderPool.createForThread(); writeExceptionToString(sb, str, e); return(StringBuilderPool.releaseStrForThread(sb)); }
/// <summary> /// 抛错 /// </summary> /// <param name="e"></param> public static void throwError(string str, Exception e) { StringBuilder sb = StringBuilderPool.createForThread(); if (str != null) { sb.Append(str); } toThrowError(sb, e); }