org.apache.james.util
Class InternetPrintWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by org.apache.james.util.InternetPrintWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class InternetPrintWriter
extends java.io.PrintWriter

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


Field Summary
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
InternetPrintWriter(java.io.OutputStream out)
          Constructor that takes a stream to wrap.
InternetPrintWriter(java.io.OutputStream out, boolean autoFlush)
          Constructor that takes a stream to wrap.
InternetPrintWriter(java.io.Writer out)
          Constructor that takes a writer to wrap.
InternetPrintWriter(java.io.Writer out, boolean autoFlush)
          Constructor that takes a writer to wrap.
 
Method Summary
 void println()
          Print a line separator.
 void println(boolean x)
          Print a boolean followed by a line separator.
 void println(char x)
          Print a char followed by a line separator.
 void println(char[] x)
          Print a character array followed by a line separator.
 void println(double x)
          Print a double followed by a line separator.
 void println(float x)
          Print a float followed by a line separator.
 void println(int x)
          Print a int followed by a line separator.
 void println(long x)
          Print a long followed by a line separator.
 void println(java.lang.Object x)
          Print an Object followed by a line separator.
 void println(java.lang.String x)
          Print a String followed by a line separator.
 
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, setError, write, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternetPrintWriter

public InternetPrintWriter(java.io.Writer out)
Constructor that takes a writer to wrap.

Parameters:
out - the wrapped Writer

InternetPrintWriter

public InternetPrintWriter(java.io.Writer out,
                           boolean autoFlush)
Constructor that takes a writer to wrap.

Parameters:
out - the wrapped Writer
autoFlush - whether to flush after each print call

InternetPrintWriter

public InternetPrintWriter(java.io.OutputStream out)
Constructor that takes a stream to wrap.

Parameters:
out - the wrapped OutputStream

InternetPrintWriter

public InternetPrintWriter(java.io.OutputStream out,
                           boolean autoFlush)
Constructor that takes a stream to wrap.

Parameters:
out - the wrapped OutputStream
autoFlush - whether to flush after each print call
Method Detail

println

public void println()
Print a line separator.

Overrides:
println in class java.io.PrintWriter

println

public void println(boolean x)
Print a boolean followed by a line separator.

Overrides:
println in class java.io.PrintWriter
Parameters:
x - the boolean to print

println

public void println(char x)
Print a char followed by a line separator.

Overrides:
println in class java.io.PrintWriter
Parameters:
x - the char to print

println

public void println(int x)
Print a int followed by a line separator.

Overrides:
println in class java.io.PrintWriter
Parameters:
x - the int to print

println

public void println(long x)
Print a long followed by a line separator.

Overrides:
println in class java.io.PrintWriter
Parameters:
x - the long to print

println

public void println(float x)
Print a float followed by a line separator.

Overrides:
println in class java.io.PrintWriter
Parameters:
x - the float to print

println

public void println(double x)
Print a double followed by a line separator.

Overrides:
println in class java.io.PrintWriter
Parameters:
x - the double to print

println

public void println(char[] x)
Print a character array followed by a line separator.

Overrides:
println in class java.io.PrintWriter
Parameters:
x - the character array to print

println

public void println(java.lang.String x)
Print a String followed by a line separator.

Overrides:
println in class java.io.PrintWriter
Parameters:
x - the String to print

println

public void println(java.lang.Object x)
Print an Object followed by a line separator.

Overrides:
println in class java.io.PrintWriter
Parameters:
x - the Object to print


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.