public final class

ChannelOutputStream

extends OutputStream
implements ErrorNotifiable
java.lang.Object
   ↳ java.io.OutputStream
     ↳ net.schmizz.sshj.connection.channel.ChannelOutputStream

Class Overview

OutputStream for channels. Buffers data upto the remote window's maximum packet size. Data can also be flushed via flush() and is also flushed on close().

Summary

Fields
private final byte[] b
private final ChannelOutputStream.DataBuffer buffer
private final Channel chan
private boolean closed
private SSHException error
private final Transport trans
private final Window.Remote win
Public Constructors
ChannelOutputStream(Channel chan, Transport trans, Window.Remote win)
Public Methods
synchronized void close()
synchronized void flush()
Send all data currently buffered.
synchronized void notifyError(SSHException error)
Notifies this object of an error.
synchronized void setClosed()
String toString()
synchronized void write(byte[] data, int off, int len)
synchronized void write(int w)
[Expand]
Inherited Methods
From class java.io.OutputStream
From class java.lang.Object
From interface java.io.Closeable
From interface java.io.Flushable
From interface net.schmizz.sshj.common.ErrorNotifiable

Fields

private final byte[] b

private final ChannelOutputStream.DataBuffer buffer

private final Channel chan

private boolean closed

private SSHException error

private final Transport trans

private final Window.Remote win

Public Constructors

public ChannelOutputStream (Channel chan, Transport trans, Window.Remote win)

Parameters
chan
trans
win

Public Methods

public synchronized void close ()

Throws
IOException

public synchronized void flush ()

Send all data currently buffered. If window space is exhausted in the process, this will block until it is expanded by the server.

Throws
IOException

public synchronized void notifyError (SSHException error)

Notifies this object of an error.

Parameters
error

public synchronized void setClosed ()

public String toString ()

public synchronized void write (byte[] data, int off, int len)

Parameters
data
off
len
Throws
IOException

public synchronized void write (int w)

Parameters
w
Throws
IOException