01: /*
02: * Created on Sep 15, 2005
03: */
04: package uk.org.ponder.streamutil.write;
05:
06: import uk.org.ponder.stringutil.CharWrap;
07:
08: public class StringPOS implements PrintOutputStream {
09: private CharWrap buffer = new CharWrap();
10:
11: public void println(String toprint) {
12: print(toprint);
13: print("\n");
14: }
15:
16: public void flush() {
17: }
18:
19: public void close() {
20: }
21:
22: public PrintOutputStream print(String string) {
23: buffer.append(string);
24: return this ;
25: }
26:
27: public void println() {
28: println("");
29: }
30:
31: public void println(Object obj) {
32: println(obj.toString());
33: }
34:
35: public String toString() {
36: return buffer.toString();
37: }
38:
39: public void write(char[] storage, int offset, int size) {
40: buffer.append(storage, offset, size);
41: }
42: }
|