FileDocCategorySizeDatePackage
InternetPrintWriter.javaAPI DocApache James 2.3.15150Fri Jan 12 12:56:34 GMT 2007org.apache.james.util

InternetPrintWriter

public class InternetPrintWriter extends PrintWriter
Writes to a wrapped Writer class, ensuring that all line separators are '\r\n', regardless of platform.

Fields Summary
private static String
lineSeparator
The line separator to use.
private final boolean
autoFlush
Whether the Writer autoflushes on line feeds
Constructors Summary
public InternetPrintWriter(Writer out)
Constructor that takes a writer to wrap.

param
out the wrapped Writer


                     
        
        super (out);
        autoFlush = false;
    
public InternetPrintWriter(Writer out, boolean autoFlush)
Constructor that takes a writer to wrap.

param
out the wrapped Writer
param
autoFlush whether to flush after each print call

        super (out, autoFlush);
        this.autoFlush = autoFlush;
    
public InternetPrintWriter(OutputStream out)
Constructor that takes a stream to wrap.

param
out the wrapped OutputStream

        super (out);
        autoFlush = false;
    
public InternetPrintWriter(OutputStream out, boolean autoFlush)
Constructor that takes a stream to wrap.

param
out the wrapped OutputStream
param
autoFlush whether to flush after each print call

        super (out, autoFlush);
        this.autoFlush = autoFlush;
    
Methods Summary
public voidprintln(float x)
Print a float followed by a line separator.

param
x the float to print

        synchronized (lock) {
            print (x);
            println ();
        }
    
public voidprintln(double x)
Print a double followed by a line separator.

param
x the double to print

        synchronized (lock) {
            print (x);
            println ();
        }
    
public voidprintln(char[] x)
Print a character array followed by a line separator.

param
x the character array to print

        synchronized (lock) {
            print (x);
            println ();
        }
    
public voidprintln(java.lang.String x)
Print a String followed by a line separator.

param
x the String to print

        synchronized (lock) {
            print (x);
            println ();
        }
    
public voidprintln(java.lang.Object x)
Print an Object followed by a line separator.

param
x the Object to print

        synchronized (lock) {
            print (x);
            println ();
        }
    
public voidprintln()
Print a line separator.

        synchronized (lock) {
            write(lineSeparator);
            if (autoFlush) {
                flush();
            }
        }
    
public voidprintln(boolean x)
Print a boolean followed by a line separator.

param
x the boolean to print

        synchronized (lock) {
            print(x);
            println();
        }
    
public voidprintln(char x)
Print a char followed by a line separator.

param
x the char to print

        synchronized (lock) {
            print (x);
            println ();
        }
    
public voidprintln(int x)
Print a int followed by a line separator.

param
x the int to print

        synchronized (lock) {
            print (x);
            println ();
        }
    
public voidprintln(long x)
Print a long followed by a line separator.

param
x the long to print

        synchronized (lock) {
            print (x);
            println ();
        }