Source code: com/prolifics/jni/ExceptionDescriber.java
1 /* @(#)ExceptionDescriber.java 77.1 99/01/13 15:47:48" */
2
3 /*************************************************/
4 /* Copyright (c) 1999 */
5 /* by */
6 /* JYACC, Inc., New York NY USA */
7 /* and contributors. */
8 /* Use of this program is governed by the */
9 /* JYACC Public License Version 1.0, a copy of */
10 /* which can be obtained at */
11 /* http://www.possl.org/jyacc-license.html */
12 /*************************************************/
13
14 package com.prolifics.jni;
15
16 import java.io.*;
17
18 public class ExceptionDescriber extends Writer
19 {
20 StringBuffer s = new StringBuffer();
21 static String describe(Throwable e)
22 {
23 ExceptionDescriber d = new ExceptionDescriber();
24 e.printStackTrace(new PrintWriter(d));
25 return d.s.toString();
26 }
27 public void write(char cbuf[], int off, int len)
28 {
29 s.append(cbuf, off, len);
30 }
31 public void flush() { }
32 public void close() { }
33 }