SSH Factory

com.jscape.inet.telnet
Class TelnetOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended bycom.jscape.inet.telnet.TelnetOutputStream

public class TelnetOutputStream
extends java.io.OutputStream

Specialised output stream used to embed Telnet commands in ASCII stream.


Constructor Summary
TelnetOutputStream(java.io.OutputStream out)
          Creates a new TelnetOutputStream instance.
 
Method Summary
 java.io.OutputStream getStream()
          Returns underlying stream.
 void println(java.lang.String line)
          Write line of data with escaping IAC terminated with LF.
 void println(java.lang.String line, java.lang.String terminator)
          Write line of data with escaping IAC terminated with specified line terminator.
 void twrite(byte[] a)
          Write data to telnet stream without escaping IAC.
 void twrite(int a)
          Write data to telnet stream without escaping IAC.
 void write(byte[] b)
          Write data to telnet stream with escaping IAC.
 void write(byte[] b, int off, int len)
          Write data to telnet stream with escaping IAC.
 void write(int a)
          Write data to telnet stream with escaping IAC.
 
Methods inherited from class java.io.OutputStream
close, flush
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TelnetOutputStream

public TelnetOutputStream(java.io.OutputStream out)
Creates a new TelnetOutputStream instance.

Parameters:
out - the output stream
Method Detail

getStream

public java.io.OutputStream getStream()
Returns underlying stream.

Returns:
the OutputStream used to construct this TelnetOutputStream

write

public void write(int a)
           throws java.io.IOException
Write data to telnet stream with escaping IAC.

Parameters:
a - the data to write
Throws:
java.io.IOException - if an I/O related error occurs

write

public void write(byte[] b)
           throws java.io.IOException
Write data to telnet stream with escaping IAC.

Parameters:
b - the data to write
Throws:
java.io.IOException - if an I/O related error occurs

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Write data to telnet stream with escaping IAC.

Parameters:
b - the data
off - the start offset in the data
len - the number of bytes to write
Throws:
java.io.IOException - if an I/O related error occurs

println

public void println(java.lang.String line)
             throws java.io.IOException
Write line of data with escaping IAC terminated with LF.

Parameters:
line - the data
Throws:
java.io.IOException - if an I/O related error occurs

println

public void println(java.lang.String line,
                    java.lang.String terminator)
             throws java.io.IOException
Write line of data with escaping IAC terminated with specified line terminator.

Parameters:
line - the data
terminator - the line terminator used
Throws:
java.io.IOException - if an I/O related error occurs

twrite

public void twrite(int a)
            throws java.io.IOException
Write data to telnet stream without escaping IAC. This method is used by the API internally to control connection/ exchange commands with server.

Parameters:
a - the data to write
Throws:
java.io.IOException - if an I/O related error occurs

twrite

public void twrite(byte[] a)
            throws java.io.IOException
Write data to telnet stream without escaping IAC. This method is used by the API internally to control connection/ exchange commands with server.

Parameters:
a - the data to write
Throws:
java.io.IOException - if an I/O related error occurs

SSH Factory

Copyright JSCAPE 2004 All Rights Reserved