Package com.icegreen.greenmail.util
Class InternetPrintWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.PrintWriter
-
- com.icegreen.greenmail.util.InternetPrintWriter
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public class InternetPrintWriter extends 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
-
-
Constructor Summary
Constructors Constructor Description InternetPrintWriter(OutputStream out)Constructor that takes a stream to wrap.InternetPrintWriter(OutputStream out, boolean autoFlush)Constructor that takes a stream to wrap.InternetPrintWriter(Writer out)Constructor that takes a writer to wrap.InternetPrintWriter(Writer out, boolean autoFlush)Constructor that takes a writer to wrap.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static InternetPrintWritercreateForEncoding(OutputStream outputStream, boolean autoFlush, Charset charset)Creates a new InternetPrintWriter for given charset encoding.voidprintln()Print a line separator.voidprintln(boolean x)Print a boolean followed by a line separator.voidprintln(char x)Print a char followed by a line separator.voidprintln(char[] x)Print a character array followed by a line separator.voidprintln(double x)Print a double followed by a line separator.voidprintln(float x)Print a float followed by a line separator.voidprintln(int x)Print an int followed by a line separator.voidprintln(long x)Print a long followed by a line separator.voidprintln(Object x)Print an Object followed by a line separator.voidprintln(String x)Print a String followed by a line separator.-
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, 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.io.Writer
nullWriter
-
-
-
-
Constructor Detail
-
InternetPrintWriter
public InternetPrintWriter(Writer out)
Constructor that takes a writer to wrap.- Parameters:
out- the wrapped Writer
-
InternetPrintWriter
public InternetPrintWriter(Writer out, boolean autoFlush)
Constructor that takes a writer to wrap.- Parameters:
out- the wrapped WriterautoFlush- whether to flush after each print call
-
InternetPrintWriter
public InternetPrintWriter(OutputStream out)
Constructor that takes a stream to wrap.- Parameters:
out- the wrapped OutputStream
-
InternetPrintWriter
public InternetPrintWriter(OutputStream out, boolean autoFlush)
Constructor that takes a stream to wrap.- Parameters:
out- the wrapped OutputStreamautoFlush- whether to flush after each print call
-
-
Method Detail
-
createForEncoding
public static InternetPrintWriter createForEncoding(OutputStream outputStream, boolean autoFlush, Charset charset)
Creates a new InternetPrintWriter for given charset encoding.- Parameters:
outputStream- the wrapped output stream.charset- the charset.- Returns:
- a new InternetPrintWriter.
-
println
public void println()
Print a line separator.- Overrides:
printlnin classPrintWriter
-
println
public void println(boolean x)
Print a boolean followed by a line separator.- Overrides:
printlnin classPrintWriter- Parameters:
x- the boolean to print
-
println
public void println(char x)
Print a char followed by a line separator.- Overrides:
printlnin classPrintWriter- Parameters:
x- the char to print
-
println
public void println(int x)
Print an int followed by a line separator.- Overrides:
printlnin classPrintWriter- Parameters:
x- the int to print
-
println
public void println(long x)
Print a long followed by a line separator.- Overrides:
printlnin classPrintWriter- Parameters:
x- the long to print
-
println
public void println(float x)
Print a float followed by a line separator.- Overrides:
printlnin classPrintWriter- Parameters:
x- the float to print
-
println
public void println(double x)
Print a double followed by a line separator.- Overrides:
printlnin classPrintWriter- Parameters:
x- the double to print
-
println
public void println(char[] x)
Print a character array followed by a line separator.- Overrides:
printlnin classPrintWriter- Parameters:
x- the character array to print
-
println
public void println(String x)
Print a String followed by a line separator.- Overrides:
printlnin classPrintWriter- Parameters:
x- the String to print
-
println
public void println(Object x)
Print an Object followed by a line separator.- Overrides:
printlnin classPrintWriter- Parameters:
x- the Object to print
-
-