Class ChannelOutputStream
java.lang.Object
java.io.OutputStream
net.schmizz.sshj.connection.channel.ChannelOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, ErrorNotifiable
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().-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface ErrorNotifiable
ErrorNotifiable.Util -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]private final ChannelOutputStream.DataBufferprivate final AbstractChannelprivate final AtomicBooleanprivate SSHExceptionprivate final Transportprivate final Window.Remote -
Constructor Summary
ConstructorsConstructorDescriptionChannelOutputStream(AbstractChannel chan, Transport trans, Window.Remote win) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidvoidclose()voidflush()Send all data currently buffered.voidnotifyError(SSHException error) Notifies this object of anerror.private static voidtoString()voidwrite(byte[] data, int off, int len) voidwrite(int w) Methods inherited from class OutputStream
nullOutputStream, write
-
Field Details
-
chan
-
trans
-
win
-
buffer
-
b
private final byte[] b -
closed
-
error
-
-
Constructor Details
-
ChannelOutputStream
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
notifyError
Description copied from interface:ErrorNotifiableNotifies this object of anerror.- Specified by:
notifyErrorin interfaceErrorNotifiable
-
checkClose
- Throws:
SSHException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
Send 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 interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
toString
-
throwStreamClosed
- Throws:
ConnectionException
-