01: /*
02: * Created on Apr 25, 2004
03: */
04: package uk.org.ponder.streamutil.write;
05:
06: /**
07: * PrintOutputStream has a number of advantages over the Java (non-)interface
08: * "Writer". <br>
09: * Firstly, it actually is an interface. <br>
10: * Secondly, it incurs no peculiar locking overheads in its operation.<br>
11: * Thirdly, its methods throw no checked exceptions. <br>
12: * There are a number of wrappers for various kinds of targets, for example
13: * standard Writers, PrintStreams, StringList and standard String. There is
14: * also a POSMulticaster for forking output to multiple streams. Note that
15: * at the pre-1.5 level, StringWriter not only includes the sync overhead of the
16: * Writer, but also the StringBuffer it constructs.
17: * @author Bosmon
18: */
19: public interface PrintOutputStream {
20: public void println(String toprint);
21:
22: public void flush();
23:
24: public void close();
25:
26: public PrintOutputStream print(String string);
27:
28: public void println();
29:
30: public void println(Object obj);
31:
32: public void write(char[] storage, int offset, int size);
33: }
|