FileDocCategorySizeDatePackage
CoyoteWriter.javaAPI DocApache Tomcat 6.0.145345Fri Jul 20 04:20:36 BST 2007org.apache.catalina.connector

CoyoteWriter

public class CoyoteWriter extends PrintWriter
Coyote implementation of the servlet writer.
author
Remy Maucherat

Fields Summary
private static final char[]
LINE_SEP
protected OutputBuffer
ob
protected boolean
error
Constructors Summary
public CoyoteWriter(OutputBuffer ob)



    // ----------------------------------------------------------- Constructors


       
        super(ob);
        this.ob = ob;
    
Methods Summary
public booleancheckError()

        flush();
        return error;
    
voidclear()
Clear facade.

        ob = null;
    
protected java.lang.Objectclone()
Prevent cloning the facade.

        throw new CloneNotSupportedException();
    
public voidclose()


        // We don't close the PrintWriter - super() is not called,
        // so the stream can be reused. We close ob.
        try {
            ob.close();
        } catch (IOException ex ) {
            ;
        }
        error = false;

    
public voidflush()


        if (error)
            return;

        try {
            ob.flush();
        } catch (IOException e) {
            error = true;
        }

    
public voidprint(boolean b)

        if (b) {
            write("true");
        } else {
            write("false");
        }
    
public voidprint(char c)

        write(c);
    
public voidprint(int i)

        write(String.valueOf(i));
    
public voidprint(long l)

        write(String.valueOf(l));
    
public voidprint(float f)

        write(String.valueOf(f));
    
public voidprint(double d)

        write(String.valueOf(d));
    
public voidprint(char[] s)

        write(s);
    
public voidprint(java.lang.String s)

        if (s == null) {
            s = "null";
        }
        write(s);
    
public voidprint(java.lang.Object obj)

        write(String.valueOf(obj));
    
public voidprintln()

        write(LINE_SEP);
    
public voidprintln(boolean b)

        print(b);
        println();
    
public voidprintln(char c)

        print(c);
        println();
    
public voidprintln(int i)

        print(i);
        println();
    
public voidprintln(long l)

        print(l);
        println();
    
public voidprintln(float f)

        print(f);
        println();
    
public voidprintln(double d)

        print(d);
        println();
    
public voidprintln(char[] c)

        print(c);
        println();
    
public voidprintln(java.lang.String s)

        print(s);
        println();
    
public voidprintln(java.lang.Object o)

        print(o);
        println();
    
voidrecycle()
Recycle.

        error = false;
    
public voidwrite(char[] buf)

	write(buf, 0, buf.length);
    
public voidwrite(java.lang.String s, int off, int len)


        if (error)
            return;

        try {
            ob.write(s, off, len);
        } catch (IOException e) {
            error = true;
        }

    
public voidwrite(java.lang.String s)

        write(s, 0, s.length());
    
public voidwrite(int c)


        if (error)
            return;

        try {
            ob.write(c);
        } catch (IOException e) {
            error = true;
        }

    
public voidwrite(char[] buf, int off, int len)


        if (error)
            return;

        try {
            ob.write(buf, off, len);
        } catch (IOException e) {
            error = true;
        }