to.etc.telnet
Class TelnetSysoutMirrorStream

java.lang.Object
  extended by java.io.OutputStream
      extended by to.etc.telnet.TelnetSysoutMirrorStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class TelnetSysoutMirrorStream
extends java.io.OutputStream

This forms a TEE for sysout and the telnet server. All data written to this stream is copied both to the Telnet server AND the system.out stream.

Author:
Frits Jalvingh

Field Summary
protected  java.io.PrintStream m_out_ps
           
protected  TelnetServer m_ts
           
 
Constructor Summary
TelnetSysoutMirrorStream(TelnetServer ts, java.io.PrintStream ps)
           
 
Method Summary
 void close()
           
 void flush()
           
 void write(byte[] parm1)
           
 void write(byte[] parm1, int offset, int len)
           
 void write(int b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_out_ps

protected java.io.PrintStream m_out_ps

m_ts

protected TelnetServer m_ts
Constructor Detail

TelnetSysoutMirrorStream

public TelnetSysoutMirrorStream(TelnetServer ts,
                                java.io.PrintStream ps)
Method Detail

write

public void write(int b)
           throws java.io.IOException
Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(byte[] parm1)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(byte[] parm1,
                  int offset,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException