iaik.security.ssl
Class ExtendedPrintWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by iaik.security.ssl.ExtendedPrintWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class ExtendedPrintWriter
extends java.io.PrintWriter

This is a PrintWriter class that lets you specify the newline to be used; e.g. if you want to use CRLF or LF only.


Field Summary
protected  boolean autoFlush_
          True, if autoflush is on.
static char[] CR
          Constant for "\r".
static char[] CRLF
          Constant for "\r\n".
static char[] LF
          Constant for "\n".
protected  char[] newLine_
          The newline to be used for linefeed.
protected  java.io.Writer out_
          The underlying writer.
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
ExtendedPrintWriter(java.io.Writer out, boolean autoFlush, char[] newLine)
          Create a new ExtendedPrintWriter.
 
Method Summary
 void close()
          Close the stream.
 boolean getAutoFlush()
          Check if auto flushing is active for println() methods.
 char[] getNewLine()
          Get the current linefeed character(s) that are used by the println() methods.
protected  void newLine()
          Print a line feed and use the newline character of this writer.
 void println()
          Finish the line.
 void println(boolean x)
          Print a boolean, and then finish the line.
 void println(char x)
          Print a character, and then finish the line.
 void println(char[] x)
          Print an array of characters, and then finish the line.
 void println(double x)
          Print a double, and then finish the line.
 void println(float x)
          Print a float, and then finish the line.
 void println(int x)
          Print an integer, and then finish the line.
 void println(long x)
          Print a long, and then finish the line.
 void println(java.lang.Object x)
          Print an Object, and then finish the line.
 void println(java.lang.String x)
          Print a String, and then finish the line.
 void setAutoFlush(boolean autoFlush)
          Enable or disable auto flushing for println() methods.
 char[] setNewLine(char[] newLine)
          Set the newline character(s) to use for linefeed by the println() methods.
 
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, 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
 

Field Detail

CRLF

public static final char[] CRLF
Constant for "\r\n".


CR

public static final char[] CR
Constant for "\r".


LF

public static final char[] LF
Constant for "\n".


out_

protected java.io.Writer out_
The underlying writer.


autoFlush_

protected boolean autoFlush_
True, if autoflush is on.


newLine_

protected char[] newLine_
The newline to be used for linefeed.

Constructor Detail

ExtendedPrintWriter

public ExtendedPrintWriter(java.io.Writer out,
                           boolean autoFlush,
                           char[] newLine)
Create a new ExtendedPrintWriter.

Parameters:
out - An output writer.
autoFlush - A boolean; if true, the println() methods will flush the output buffer.
Method Detail

newLine

protected void newLine()
Print a line feed and use the newline character of this writer.


println

public void println()
Finish the line.

Overrides:
println in class java.io.PrintWriter

println

public void println(boolean x)
Print a boolean, and then finish the line.

Overrides:
println in class java.io.PrintWriter

println

public void println(char x)
Print a character, and then finish the line.

Overrides:
println in class java.io.PrintWriter

println

public void println(int x)
Print an integer, and then finish the line.

Overrides:
println in class java.io.PrintWriter

println

public void println(long x)
Print a long, and then finish the line.

Overrides:
println in class java.io.PrintWriter

println

public void println(float x)
Print a float, and then finish the line.

Overrides:
println in class java.io.PrintWriter

println

public void println(double x)
Print a double, and then finish the line.

Overrides:
println in class java.io.PrintWriter

println

public void println(char[] x)
Print an array of characters, and then finish the line.

Overrides:
println in class java.io.PrintWriter

println

public void println(java.lang.String x)
Print a String, and then finish the line.

Overrides:
println in class java.io.PrintWriter

println

public void println(java.lang.Object x)
Print an Object, and then finish the line.

Overrides:
println in class java.io.PrintWriter

setNewLine

public char[] setNewLine(char[] newLine)
Set the newline character(s) to use for linefeed by the println() methods.

Parameters:
newLine - The new linefeed character(s) (the newLine char array is not cloned or copied by this method).
Returns:
The linefeed character that were set before this call.

getNewLine

public char[] getNewLine()
Get the current linefeed character(s) that are used by the println() methods.

Returns:
The current linefeed character(s).

getAutoFlush

public boolean getAutoFlush()
Check if auto flushing is active for println() methods.

Returns:
True, if auto flushing is active.

setAutoFlush

public void setAutoFlush(boolean autoFlush)
Enable or disable auto flushing for println() methods.

Parameters:
autoFlush - True, to enable auto flushing.

close

public void close()
Close the stream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.PrintWriter

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

iSaSiLk 6.0, (c) 2002 IAIK, (c) 2003 - 2015 SIC