KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > pmd > util > designer > MyPrintStream


1 package net.sourceforge.pmd.util.designer;
2
3 import java.io.PrintStream JavaDoc;
4
5 public class MyPrintStream extends PrintStream JavaDoc {
6
7     private StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
8     
9     private static final String JavaDoc LINE_SEPARATOR = System.getProperty("line.separator");
10     
11     public MyPrintStream() {
12         super(System.out);
13     }
14
15     public void println(String JavaDoc s) {
16         super.println(s);
17         buf.append(s);
18         buf.append(LINE_SEPARATOR);
19     }
20
21     public String JavaDoc getString() {
22         return buf.toString();
23     }
24 }
25
26
Popular Tags