// 
// Decompiled by Procyon v0.6.0
// 

package org.fusesource.jansi;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.io.OutputStream;
import org.fusesource.jansi.io.AnsiOutputStream;
import java.io.PrintStream;

public class AnsiPrintStream extends PrintStream
{
    public AnsiPrintStream(final AnsiOutputStream out, final boolean autoFlush) {
        super(out, autoFlush);
    }
    
    public AnsiPrintStream(final AnsiOutputStream out, final boolean autoFlush, final String encoding) throws UnsupportedEncodingException {
        super(out, autoFlush, encoding);
    }
    
    protected AnsiOutputStream getOut() {
        return (AnsiOutputStream)this.out;
    }
    
    public AnsiType getType() {
        return this.getOut().getType();
    }
    
    public AnsiColors getColors() {
        return this.getOut().getColors();
    }
    
    public AnsiMode getMode() {
        return this.getOut().getMode();
    }
    
    public void setMode(final AnsiMode ansiMode) {
        this.getOut().setMode(ansiMode);
    }
    
    public boolean isResetAtUninstall() {
        return this.getOut().isResetAtUninstall();
    }
    
    public void setResetAtUninstall(final boolean resetAtClose) {
        this.getOut().setResetAtUninstall(resetAtClose);
    }
    
    public int getTerminalWidth() {
        return this.getOut().getTerminalWidth();
    }
    
    public void install() throws IOException {
        this.getOut().install();
    }
    
    public void uninstall() throws IOException {
        final AnsiOutputStream out = this.getOut();
        if (out != null) {
            out.uninstall();
        }
    }
    
    @Override
    public String toString() {
        return "AnsiPrintStream{type=" + this.getType() + ", colors=" + this.getColors() + ", mode=" + this.getMode() + ", resetAtUninstall=" + this.isResetAtUninstall() + "}";
    }
}
