Class ChannelOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- net.schmizz.sshj.connection.channel.ChannelOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable,ErrorNotifiable
public final class ChannelOutputStream extends java.io.OutputStream implements ErrorNotifiable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classChannelOutputStream.DataBuffer-
Nested classes/interfaces inherited from interface net.schmizz.sshj.common.ErrorNotifiable
ErrorNotifiable.Util
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]bprivate ChannelOutputStream.DataBufferbufferprivate AbstractChannelchanprivate java.util.concurrent.atomic.AtomicBooleanclosedprivate SSHExceptionerrorprivate Transporttransprivate Window.Remotewin
-
Constructor Summary
Constructors Constructor Description ChannelOutputStream(AbstractChannel chan, Transport trans, Window.Remote win)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckClose()voidclose()voidflush()Send all data currently buffered.voidnotifyError(SSHException error)Notifies this object of anerror.private static voidthrowStreamClosed()java.lang.StringtoString()voidwrite(byte[] data, int off, int len)voidwrite(int w)
-
-
-
Field Detail
-
chan
private final AbstractChannel chan
-
trans
private final Transport trans
-
win
private final Window.Remote win
-
buffer
private final ChannelOutputStream.DataBuffer buffer
-
b
private final byte[] b
-
closed
private final java.util.concurrent.atomic.AtomicBoolean closed
-
error
private SSHException error
-
-
Constructor Detail
-
ChannelOutputStream
public ChannelOutputStream(AbstractChannel chan, Transport trans, Window.Remote win)
-
-
Method Detail
-
write
public void write(int w) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] data, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
notifyError
public void notifyError(SSHException error)
Description copied from interface:ErrorNotifiableNotifies this object of anerror.- Specified by:
notifyErrorin interfaceErrorNotifiable
-
checkClose
private void checkClose() throws SSHException- Throws:
SSHException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOExceptionSend all data currently buffered. If window space is exhausted in the process, this will block until it is expanded by the server.- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
throwStreamClosed
private static void throwStreamClosed() throws ConnectionException- Throws:
ConnectionException
-
-