Package com.trilead.ssh2
Class LocalStreamForwarder
- java.lang.Object
-
- com.trilead.ssh2.LocalStreamForwarder
-
public class LocalStreamForwarder extends java.lang.ObjectALocalStreamForwarderforwards an Input- and Outputstream pair via the secure tunnel to another host (which may or may not be identical to the remote SSH-2 server).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the underlying SSH forwarding channel and free up resources.java.io.InputStreamgetInputStream()java.io.OutputStreamgetOutputStream()Get the OutputStream.
-
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException- Returns:
- An
InputStreamobject. - Throws:
java.io.IOException
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOExceptionGet the OutputStream. Please be aware that the implementation MAY use an internal buffer. To make sure that the buffered data is sent over the tunnel, you have to call theflushmethod of theOutputStream. To signal EOF, please use theclosemethod of theOutputStream.- Returns:
- An
OutputStreamobject. - Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionClose the underlying SSH forwarding channel and free up resources. You can also 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), then this call is a no-op.- Throws:
java.io.IOException
-
-