Ganymed SSH2 for Java

ch.ethz.ssh2
Class LocalStreamForwarder

java.lang.Object
  extended bych.ethz.ssh2.LocalStreamForwarder

public class LocalStreamForwarder
extends java.lang.Object

A LocalStreamForwarder forwards an Input- and Outputstream pair via the secure tunnel to another host (which may or may not be identical to the remote SSH2 server).

Version:
$Id: LocalStreamForwarder.java,v 1.1 2005/07/04 13:58:41 cplattne Exp $
Author:
Christian Plattner, plattner@inf.ethz.ch

Method Summary
 void close()
          Close the underlying SSH forwarding channel.
 java.io.InputStream getInputStream()
           
 java.io.OutputStream getOutputStream()
          Get the OutputStream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns:
An InputStream object.
Throws:
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Get the OutputStream. Please be aware that the implementation uses an internal buffer. To make sure that the buffered data is sent over the tunnel, you have to call the flush method of the OutputStream. To signal EOF, please use the close method of the OutputStream.

Returns:
An OutputStream object.
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Close the underlying SSH forwarding channel. Normally, you do not need this method, however, you can use this method to force the shutdown of the underlying forwarding channel. Pending output (OutputStream not flushed) will NOT be sent. Pending input (InputStream) can still be read. If the shutdown operation is already in progress (initiated from either side), this call does nothing. This method is useful if you (for whatever reason) want to free resources and do not want to wait until the peer has sent EOF on the InputStream (normally, the underlying channel is not actively closed from our side. Wait we until the server sends the close message (i.e. after both us and the server have sent EOF)).

Throws:
java.io.IOException

Ganymed SSH2 for Java