1 23 package com.sun.enterprise.admin.util; 24 25 import java.io.ByteArrayOutputStream ; 27 import java.io.PrintStream ; 28 29 import com.sun.enterprise.admin.util.Assert; 31 32 33 39 public final class ThrowableToString 40 { 41 private final static int kDefaultBufferSize = 512; 42 43 private final Throwable mThrowable; 44 45 50 public 51 ThrowableToString( Throwable throwable ) 52 { 53 Assert.assertit( throwable != null, "null throwable" ); 54 mThrowable = throwable; 55 } 56 57 60 public String 61 toString() 62 { 63 final ByteArrayOutputStream output = 64 new ByteArrayOutputStream ( kDefaultBufferSize ); 65 final PrintStream print = new PrintStream ( output ); 66 67 mThrowable.printStackTrace( print ); 68 69 return( output.toString() ); 70 } 71 } 72 73 74 75 | Popular Tags |