com.waveset.adapter.ScriptedConnection
Class NVTInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended bycom.waveset.adapter.ScriptedConnection.NVTInputStream

public class NVTInputStream
extends java.io.FilterInputStream

A filtered input stream that will handle the Telnet protocol by implementing a Network Virtual Terminal (NVT) as described in RFC 854 and Option Negotiation as described in RFC 1143


Field Summary
static java.lang.String code_id
           
static byte TC_IAC
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
NVTInputStream(java.io.InputStream input, java.io.OutputStream output)
          Constructor takes input stream for reading telnet commands and data, and output stream for sending telnet commands to server to keep handshaking going.
NVTInputStream(java.io.InputStream input, java.io.OutputStream output, java.lang.String term)
           
 
Method Summary
 int read()
          Reads a character from the stream and looks for any embedded TELNET protocol commands and takes the appropriate action
 int read(byte[] b)
          Reads data from the stream and looks for any embedded TELNET protocol commands and takes the appropriate action
 int read(byte[] b, int offset, int length)
          reads data from the stream and looks for any embedded TELNET protocol commands and takes the appropriate action.
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

TC_IAC

public static final byte TC_IAC
See Also:
Constant Field Values
Constructor Detail

NVTInputStream

public NVTInputStream(java.io.InputStream input,
                      java.io.OutputStream output)
Constructor takes input stream for reading telnet commands and data, and output stream for sending telnet commands to server to keep handshaking going.


NVTInputStream

public NVTInputStream(java.io.InputStream input,
                      java.io.OutputStream output,
                      java.lang.String term)
Method Detail

read

public int read()
         throws java.io.IOException
Reads a character from the stream and looks for any embedded TELNET protocol commands and takes the appropriate action

Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Reads data from the stream and looks for any embedded TELNET protocol commands and takes the appropriate action

Throws:
java.io.IOException

read

public int read(byte[] b,
                int offset,
                int length)
         throws java.io.IOException
reads data from the stream and looks for any embedded TELNET protocol commands and takes the appropriate action.

Telnet option negotiation is coded according to RFC 1143

Throws:
java.io.IOException