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 class
ChannelOutputStream.OpenState
protected static class
ChannelOutputStream.WriteState
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
log
protected AtomicReference<ChannelOutputStream.OpenState>
openState
-
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, 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 void
close()
void
flush()
AbstractChannel
getChannel()
byte
getCommandType()
boolean
isEofOnClose()
boolean
isNoDelay()
boolean
isOpen()
protected Buffer
newBuffer(int size)
void
setNoDelay(boolean noDelay)
String
toString()
void
write(byte[] buf, int s, int l)
void
write(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, 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, Duration maxWaitTimeout, org.slf4j.Logger log, byte cmd, boolean eofOnClose)
-
-
Method Detail
-
getChannel
public AbstractChannel getChannel()
- Specified by:
getChannel
in interfaceChannelHolder
- Returns:
- The associated
Channel
instance
-
getCommandType
public byte getCommandType()
- Returns:
- Either
SSH_MSG_CHANNEL_DATA
orSSH_MSG_CHANNEL_EXTENDED_DATA
indicating 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:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] buf, int s, int l) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
newBuffer
protected Buffer newBuffer(int size)
-
-