SSH Factory

com.jscape.inet.telnet
Class TelnetOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.jscape.inet.telnet.TelnetOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

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.
TelnetOutputStream(java.io.OutputStream out, java.lang.String characterSet)
           
 
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

TelnetOutputStream

public TelnetOutputStream(java.io.OutputStream out,
                          java.lang.String characterSet)
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.

Specified by:
write in class java.io.OutputStream
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.

Overrides:
write in class java.io.OutputStream
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.

Overrides:
write in class java.io.OutputStream
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 LLC. 1999-2011. All Rights Reserved