Package org.apache.sshd.common.channel
Class ChannelOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.sshd.common.channel.ChannelOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable,java.nio.channels.Channel,ChannelHolder
public class ChannelOutputStream extends java.io.OutputStream implements java.nio.channels.Channel, ChannelHolder
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]bprivate Bufferbufferprivate intbufferLengthprivate AbstractChannelchannelInstanceprivate java.util.concurrent.atomic.AtomicBooleanclosedStateprivate bytecmdprivate booleaneofOnCloseprivate intlastSizeprotected org.slf4j.Loggerlogprivate java.time.DurationmaxWaitTimeoutprivate booleannoDelayprivate ChannelStreamWriterpacketWriterprivate WindowremoteWindow
-
Constructor Summary
Constructors Constructor Description ChannelOutputStream(AbstractChannel channel, Window remoteWindow, long maxWaitTimeout, org.slf4j.Logger log, byte cmd, boolean eofOnClose)ChannelOutputStream(AbstractChannel channel, Window remoteWindow, java.time.Duration maxWaitTimeout, org.slf4j.Logger log, byte cmd, boolean eofOnClose)ChannelOutputStream(AbstractChannel channel, Window remoteWindow, org.slf4j.Logger log, byte cmd, boolean eofOnClose)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()AbstractChannelgetChannel()bytegetCommandType()booleanisEofOnClose()booleanisNoDelay()booleanisOpen()protected voidnewBuffer(int size)voidsetNoDelay(boolean noDelay)java.lang.StringtoString()voidwrite(byte[] buf, int s, int l)voidwrite(int w)
-
-
-
Field Detail
-
log
protected final org.slf4j.Logger log
-
channelInstance
private final AbstractChannel channelInstance
-
packetWriter
private final ChannelStreamWriter packetWriter
-
remoteWindow
private final Window remoteWindow
-
maxWaitTimeout
private final java.time.Duration maxWaitTimeout
-
cmd
private final byte cmd
-
eofOnClose
private final boolean eofOnClose
-
b
private final byte[] b
-
closedState
private final java.util.concurrent.atomic.AtomicBoolean closedState
-
buffer
private Buffer buffer
-
bufferLength
private int bufferLength
-
lastSize
private int lastSize
-
noDelay
private boolean noDelay
-
-
Constructor Detail
-
ChannelOutputStream
public ChannelOutputStream(AbstractChannel channel, Window remoteWindow, org.slf4j.Logger log, byte cmd, boolean eofOnClose)
-
ChannelOutputStream
public ChannelOutputStream(AbstractChannel channel, Window remoteWindow, long maxWaitTimeout, org.slf4j.Logger log, byte cmd, boolean eofOnClose)
-
ChannelOutputStream
public ChannelOutputStream(AbstractChannel channel, Window remoteWindow, java.time.Duration maxWaitTimeout, org.slf4j.Logger log, byte cmd, boolean eofOnClose)
-
-
Method Detail
-
getChannel
public AbstractChannel getChannel()
- Specified by:
getChannelin interfaceChannelHolder- Returns:
- The associated
Channelinstance
-
getCommandType
public byte getCommandType()
- Returns:
- Either
SSH_MSG_CHANNEL_DATAorSSH_MSG_CHANNEL_EXTENDED_DATAindicating the output stream type
-
isEofOnClose
public boolean isEofOnClose()
-
isNoDelay
public boolean isNoDelay()
-
setNoDelay
public void setNoDelay(boolean noDelay)
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfacejava.nio.channels.Channel
-
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[] buf, int s, int l) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.nio.channels.Channel- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
newBuffer
protected void newBuffer(int size)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-