PrintStreamOutputDevice.java :  » Database-Client » Henplus » henplus » Java Open Source

Java Open Source » Database Client » Henplus 
Henplus » henplus » PrintStreamOutputDevice.java
/*
 * This is free software, licensed under the Gnu Public License (GPL)
 * get a copy from <http://www.gnu.org/licenses/gpl.html>
 * $Id: PrintStreamOutputDevice.java,v 1.3 2005/03/24 13:57:46 hzeller Exp $
 * author: Henner Zeller <H.Zeller@acm.org>
 */
package henplus;

import java.io.PrintStream;

/**
 * The OutputDevice to write to.
 */
public class PrintStreamOutputDevice implements OutputDevice {
    private final PrintStream _outStream;

    public PrintStreamOutputDevice(PrintStream out) {
        _outStream = out;
    }

    public void flush()            {  _outStream.flush();  }
    public void write(byte[] buffer, int off, int len) {
        _outStream.write(buffer, off, len);
    }
    public void print(String s)    { _outStream.print(s);  }
    public void println(String s)  { _outStream.println(s);  }
    public void println()          { _outStream.println(); }

    public void close() { _outStream.close(); }

    public void attributeBold()  { /* no attributes */ }
    public void attributeGrey()  { /* no attributes */ }

    public void attributeReset() { /* no attributes */ }

    public boolean isTerminal() { return false; }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.