01: /*
02: * StringPrintStream.java
03: *
04: * Created on 25 février 2005, 18:30
05: */
06:
07: package salomeTMF_plug.simpleJunit;
08:
09: import java.io.OutputStream;
10:
11: /**
12: *
13: * @author marchemi
14: */
15: public class StringPrintStream extends OutputStream {
16:
17: String log;
18:
19: /** Creates a new instance of StringPrintStream */
20: public StringPrintStream() {
21: super ();
22: log = "";
23: }
24:
25: public void close() {
26:
27: }
28:
29: public void flush() {
30:
31: }
32:
33: public void write(byte[] b) {
34: log += new String(b);
35: }
36:
37: public void write(byte[] b, int off, int len) {
38: log += new String(b, off, len);
39: }
40:
41: public void write(int b) {
42: log += b;
43: }
44:
45: String getLog() {
46: return log;
47: }
48: }
|