01: /*
02: * This is free software, licensed under the Gnu Public License (GPL)
03: * get a copy from <http://www.gnu.org/licenses/gpl.html>
04: * $Id: PrintStreamOutputDevice.java,v 1.3 2005/03/24 13:57:46 hzeller Exp $
05: * author: Henner Zeller <H.Zeller@acm.org>
06: */
07: package henplus;
08:
09: import java.io.PrintStream;
10:
11: /**
12: * The OutputDevice to write to.
13: */
14: public class PrintStreamOutputDevice implements OutputDevice {
15: private final PrintStream _outStream;
16:
17: public PrintStreamOutputDevice(PrintStream out) {
18: _outStream = out;
19: }
20:
21: public void flush() {
22: _outStream.flush();
23: }
24:
25: public void write(byte[] buffer, int off, int len) {
26: _outStream.write(buffer, off, len);
27: }
28:
29: public void print(String s) {
30: _outStream.print(s);
31: }
32:
33: public void println(String s) {
34: _outStream.println(s);
35: }
36:
37: public void println() {
38: _outStream.println();
39: }
40:
41: public void close() {
42: _outStream.close();
43: }
44:
45: public void attributeBold() { /* no attributes */
46: }
47:
48: public void attributeGrey() { /* no attributes */
49: }
50:
51: public void attributeReset() { /* no attributes */
52: }
53:
54: public boolean isTerminal() {
55: return false;
56: }
57: }
|