Class ClientServer.TelnetPrintWriter

java.lang.Object
  extended byjava.io.Writer
      extended byjava.io.PrintWriter
          extended byClientServer.TelnetPrintWriter
Enclosing class:
ClientServer

public class ClientServer.TelnetPrintWriter
extends PrintWriter

Extends the PrintWriter class to replace the println() method, so that it always prints a CR LF, which is required by the telnet protocol.

Unfortunately, this class has to reimplement all the constructors even though all that is needed is the re-done println() method. Feh.

Author:
Kevin Thompson [antiduh@csh.rit.edu]

Field Summary
(package private)  boolean autoFlush
           
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
(package private) ClientServer.TelnetPrintWriter(OutputStream out)
          Create a new PrintWriter, without automatic line flushing, from an existing OutputStream.
(package private) ClientServer.TelnetPrintWriter(OutputStream out, boolean _autoFlush)
          Create a new PrintWriter from an existing OutputStream.
(package private) ClientServer.TelnetPrintWriter(Writer out)
          Create a new PrintWriter, without automatic line flushing.
(package private) ClientServer.TelnetPrintWriter(Writer out, boolean _autoFlush)
          Creates a new PrintWriter.
 
Method Summary
 void println()
          Reimplements the println() method in PrintWriter so that a CR LF is always printed, instead of whatever system.lineseperater says.
 
Methods inherited from class java.io.PrintWriter
checkError, close, flush, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, println, 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

autoFlush

boolean autoFlush
Constructor Detail

ClientServer.TelnetPrintWriter

ClientServer.TelnetPrintWriter(OutputStream out)
Create a new PrintWriter, without automatic line flushing, from an existing OutputStream. This method just feeds the arguments to super.

Parameters:
out - An output stream.

ClientServer.TelnetPrintWriter

ClientServer.TelnetPrintWriter(OutputStream out,
                               boolean _autoFlush)
Create a new PrintWriter from an existing OutputStream. This method just feeds the arguments to super.

Parameters:
out - An output stream.
_autoFlush - If true, then the println() method will flush the buffer.

ClientServer.TelnetPrintWriter

ClientServer.TelnetPrintWriter(Writer out)
Create a new PrintWriter, without automatic line flushing. This method just feeds the arguments to super.

Parameters:
out - A character output stream.

ClientServer.TelnetPrintWriter

ClientServer.TelnetPrintWriter(Writer out,
                               boolean _autoFlush)
Creates a new PrintWriter. This method just feeds the arguments to super.

Parameters:
out - A character output stream.
_autoFlush - If true, then the println() method will flush the buffer.
Method Detail

println

public void println()
Reimplements the println() method in PrintWriter so that a CR LF is always printed, instead of whatever system.lineseperater says. This is done because this is what the telnet protocol specifies.