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 net.schmizz.sshj.common.ErrorNotifiable
ErrorNotifiable.Util
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]
private final ChannelOutputStream.DataBuffer
private final AbstractChannel
private AtomicBoolean
private SSHException
private final Transport
private final Window.Remote
-
Constructor Summary
ConstructorsConstructorDescriptionChannelOutputStream
(AbstractChannel chan, Transport trans, Window.Remote win) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
void
close()
void
flush()
Send all data currently buffered.void
notifyError
(SSHException error) Notifies this object of anerror
.private static void
toString()
void
write
(byte[] data, int off, int len) void
write
(int w) Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Field Details
-
chan
-
trans
-
win
-
buffer
-
b
private final byte[] b -
closed
-
error
-
-
Constructor Details
-
ChannelOutputStream
-
-
Method Details
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
notifyError
Description copied from interface:ErrorNotifiable
Notifies this object of anerror
.- Specified by:
notifyError
in interfaceErrorNotifiable
-
checkClose
- Throws:
SSHException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in 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:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
toString
-
throwStreamClosed
- Throws:
ConnectionException
-