Package org.apache.sshd.common.channel
Class ChannelOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.sshd.common.channel.ChannelOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,Channel,ChannelHolder
public class ChannelOutputStream extends OutputStream implements Channel, ChannelHolder
- Author:
- Apache MINA SSHD Project
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classChannelOutputStream.OpenStateprotected static classChannelOutputStream.WriteState
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Loggerlogprotected AtomicReference<ChannelOutputStream.OpenState>openState
-
Constructor Summary
Constructors Constructor Description ChannelOutputStream(AbstractChannel channel, RemoteWindow remoteWindow, long maxWaitTimeout, org.slf4j.Logger log, byte cmd, boolean eofOnClose)ChannelOutputStream(AbstractChannel channel, RemoteWindow remoteWindow, Duration maxWaitTimeout, org.slf4j.Logger log, byte cmd, boolean eofOnClose)ChannelOutputStream(AbstractChannel channel, RemoteWindow 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 BuffernewBuffer(int size)voidsetNoDelay(boolean noDelay)StringtoString()voidwrite(byte[] buf, int s, int l)voidwrite(int w)-
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
-
-
-
Field Detail
-
openState
protected final AtomicReference<ChannelOutputStream.OpenState> openState
-
log
protected final org.slf4j.Logger log
-
-
Constructor Detail
-
ChannelOutputStream
public ChannelOutputStream(AbstractChannel channel, RemoteWindow remoteWindow, org.slf4j.Logger log, byte cmd, boolean eofOnClose)
-
ChannelOutputStream
public ChannelOutputStream(AbstractChannel channel, RemoteWindow remoteWindow, long maxWaitTimeout, org.slf4j.Logger log, byte cmd, boolean eofOnClose)
-
ChannelOutputStream
public ChannelOutputStream(AbstractChannel channel, RemoteWindow remoteWindow, 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)
-
write
public void write(int w) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] buf, int s, int l) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
newBuffer
protected Buffer newBuffer(int size)
-
-