Class InternetPrintWriter
java.lang.Object
java.io.Writer
java.io.PrintWriter
com.icegreen.greenmail.util.InternetPrintWriter
- All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable
Writes to a wrapped Writer class, ensuring that all line separators are '\r\n', regardless
of platform.
-
Field Summary
Fields inherited from class PrintWriter
out -
Constructor Summary
ConstructorsConstructorDescriptionConstructor that takes a stream to wrap.InternetPrintWriter(OutputStream out, boolean autoFlush) Constructor that takes a stream to wrap.Constructor that takes a writer to wrap.InternetPrintWriter(Writer out, boolean autoFlush) Constructor that takes a writer to wrap. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.voidPrint an Object followed by a line separator.voidPrint a String followed by a line separator.
-
Constructor Details
-
InternetPrintWriter
Constructor that takes a writer to wrap.- Parameters:
out- the wrapped Writer
-
InternetPrintWriter
Constructor that takes a writer to wrap.- Parameters:
out- the wrapped WriterautoFlush- whether to flush after each print call
-
InternetPrintWriter
Constructor that takes a stream to wrap.- Parameters:
out- the wrapped OutputStream
-
InternetPrintWriter
Constructor that takes a stream to wrap.- Parameters:
out- the wrapped OutputStreamautoFlush- whether to flush after each print call
-
-
Method Details
-
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
-
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
Print a String followed by a line separator.- Overrides:
printlnin classPrintWriter- Parameters:
x- the String to print
-
println
Print an Object followed by a line separator.- Overrides:
printlnin classPrintWriter- Parameters:
x- the Object to print
-