Mercurial > 510Connectbot
diff src/ch/ethz/ssh2/LocalStreamForwarder.java @ 308:42b15aaa7ac7 ganymed
merge
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 30 Jul 2014 14:21:50 -0700 |
parents | 071eccdff8ea |
children |
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/LocalStreamForwarder.java Wed Jul 30 13:38:04 2014 -0700 +++ b/src/ch/ethz/ssh2/LocalStreamForwarder.java Wed Jul 30 14:21:50 2014 -0700 @@ -20,55 +20,50 @@ * @author Christian Plattner * @version 2.50, 03/15/10 */ -public class LocalStreamForwarder -{ - private ChannelManager cm; +public class LocalStreamForwarder { + private ChannelManager cm; - private Channel cn; + private Channel cn; - LocalStreamForwarder(ChannelManager cm, String host_to_connect, int port_to_connect) throws IOException - { - this.cm = cm; - cn = cm.openDirectTCPIPChannel(host_to_connect, port_to_connect, - InetAddress.getLocalHost().getHostAddress(), 0); - } + LocalStreamForwarder(ChannelManager cm, String host_to_connect, int port_to_connect) throws IOException { + this.cm = cm; + cn = cm.openDirectTCPIPChannel(host_to_connect, port_to_connect, + InetAddress.getLocalHost().getHostAddress(), 0); + } - /** - * @return An <code>InputStream</code> object. - * @throws IOException - */ - public InputStream getInputStream() throws IOException - { - return cn.getStdoutStream(); - } + /** + * @return An <code>InputStream</code> object. + * @throws IOException + */ + public InputStream getInputStream() throws IOException { + return cn.getStdoutStream(); + } - /** - * Get 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 the <code>flush</code> method of the - * <code>OutputStream</code>. To signal EOF, please use the - * <code>close</code> method of the <code>OutputStream</code>. - * - * @return An <code>OutputStream</code> object. - * @throws IOException - */ - public OutputStream getOutputStream() throws IOException - { - return cn.getStdinStream(); - } + /** + * Get 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 the <code>flush</code> method of the + * <code>OutputStream</code>. To signal EOF, please use the + * <code>close</code> method of the <code>OutputStream</code>. + * + * @return An <code>OutputStream</code> object. + * @throws IOException + */ + public OutputStream getOutputStream() throws IOException { + return cn.getStdinStream(); + } - /** - * Close 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 IOException - */ - public void close() throws IOException - { - cm.closeChannel(cn, "Closed due to user request.", true); - } + /** + * Close 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 IOException + */ + public void close() throws IOException { + cm.closeChannel(cn, "Closed due to user request.", true); + } }