|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectClientServer.ClientServerThread.TelnetInputReader
This class handles the input gathering and processing functions as well
as the required echoing.
In order to be able to hide the users password when they enter it to log
in, the telnet client must be set up to not locally echo anything.
This is done by ClientServer.negotiate(). Since the client is not
echoing, we must do the echoing.
Currently, the class properly handles carriage returns and backspaces,
and ignores line-feeds and arrow keys.
Telnet protocol specifies that a newline is defined as a CR LF sequence,
regardless of platform. The class catches the first CR, ignores any
subsequent line feeds and calls TelnetPrintWriter.println(), whose
purpose is to output CR LF sequences alongside the responsibilities
of PrintWriter.
| Field Summary | |
static int |
A_BS
|
static int |
A_CR
|
static int |
A_DEL
|
static int |
A_ESC
|
static int |
A_LF
|
static int |
A_NAK
|
static int |
A_NUL
|
static int |
A_SP
|
private BufferedInputStream |
in
|
private PrintWriter |
out
|
static int |
T_IAC
|
| Constructor Summary | |
ClientServer.ClientServerThread.TelnetInputReader(BufferedInputStream _in,
PrintWriter _out)
Constructs the TelnetInputReader. |
|
| Method Summary | |
String |
intDump(String input)
Takes the given string input and converts it to a decimal string in the form 100:100:90:80 so that unprinted characters will be 'visible' |
int |
read(boolean echo)
Reads a single character from the input BufferedInputStream. |
String |
readLine(boolean echo)
Reads a line of text using the read() method defined above. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int A_BS
public static final int A_LF
public static final int A_CR
public static final int A_NAK
public static final int A_ESC
public static final int A_SP
public static final int A_DEL
public static final int A_NUL
public static final int T_IAC
private BufferedInputStream in
private PrintWriter out
| Constructor Detail |
public ClientServer.ClientServerThread.TelnetInputReader(BufferedInputStream _in,
PrintWriter _out)
_in - The BufferedInputStream to read from._out - The printwriter to echo to| Method Detail |
public int read(boolean echo)
throws IOException
echo - If true, 'normal' unhandled chars are sent back through
the class's PrintWriter
IOException
public String readLine(boolean echo)
throws IOException
echo - Whether or not to echo unhandled characters.
IOExceptionpublic String intDump(String input)
input - The input to convert to a a decimal string
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||