public class ChannelOutputStream extends java.io.OutputStream implements java.nio.channels.Channel, ChannelHolder
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ChannelOutputStream.OpenState |
protected static class |
ChannelOutputStream.WriteState |
| Modifier and Type | Field and Description |
|---|---|
private Buffer |
buffer |
private int |
bufferLength |
private java.lang.Object |
bufferLock |
private AbstractChannel |
channelInstance |
private byte |
cmd |
private boolean |
eofOnClose |
private boolean |
isFlushing |
private int |
lastSize |
protected org.slf4j.Logger |
log |
private java.time.Duration |
maxWaitTimeout |
private java.util.concurrent.atomic.AtomicBoolean |
noDelay |
protected java.util.concurrent.atomic.AtomicReference<ChannelOutputStream.OpenState> |
openState |
private ChannelStreamWriter |
packetWriter |
private RemoteWindow |
remoteWindow |
| Constructor and Description |
|---|
ChannelOutputStream(AbstractChannel channel,
RemoteWindow remoteWindow,
java.time.Duration maxWaitTimeout,
org.slf4j.Logger log,
byte cmd,
boolean eofOnClose) |
ChannelOutputStream(AbstractChannel channel,
RemoteWindow remoteWindow,
org.slf4j.Logger log,
byte cmd,
boolean eofOnClose) |
ChannelOutputStream(AbstractChannel channel,
RemoteWindow remoteWindow,
long maxWaitTimeout,
org.slf4j.Logger log,
byte cmd,
boolean eofOnClose) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
AbstractChannel |
getChannel() |
byte |
getCommandType() |
boolean |
isEofOnClose() |
boolean |
isNoDelay() |
boolean |
isOpen() |
protected Buffer |
newBuffer(int size) |
void |
setNoDelay(boolean noDelay) |
java.lang.String |
toString() |
void |
write(byte[] buf,
int s,
int l) |
void |
write(int w) |
protected final java.util.concurrent.atomic.AtomicReference<ChannelOutputStream.OpenState> openState
protected final org.slf4j.Logger log
private final AbstractChannel channelInstance
private final ChannelStreamWriter packetWriter
private final RemoteWindow remoteWindow
private final java.time.Duration maxWaitTimeout
private final byte cmd
private final boolean eofOnClose
private final java.util.concurrent.atomic.AtomicBoolean noDelay
private final java.lang.Object bufferLock
private Buffer buffer
private int bufferLength
private int lastSize
private boolean isFlushing
public ChannelOutputStream(AbstractChannel channel, RemoteWindow remoteWindow, org.slf4j.Logger log, byte cmd, boolean eofOnClose)
public ChannelOutputStream(AbstractChannel channel, RemoteWindow remoteWindow, long maxWaitTimeout, org.slf4j.Logger log, byte cmd, boolean eofOnClose)
public ChannelOutputStream(AbstractChannel channel, RemoteWindow remoteWindow, java.time.Duration maxWaitTimeout, org.slf4j.Logger log, byte cmd, boolean eofOnClose)
public AbstractChannel getChannel()
getChannel in interface ChannelHolderChannel instancepublic byte getCommandType()
SSH_MSG_CHANNEL_DATA or
SSH_MSG_CHANNEL_EXTENDED_DATA indicating the output
stream typepublic boolean isEofOnClose()
public boolean isNoDelay()
public void setNoDelay(boolean noDelay)
public boolean isOpen()
isOpen in interface java.nio.channels.Channelpublic void write(int w)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] buf,
int s,
int l)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface java.nio.channels.Channelclose in class java.io.OutputStreamjava.io.IOExceptionprotected Buffer newBuffer(int size)
public java.lang.String toString()
toString in class java.lang.Object