Class ChannelInputStream
- java.lang.Object
-
- java.io.InputStream
-
- net.schmizz.sshj.connection.channel.ChannelInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,ErrorNotifiable
public final class ChannelInputStream extends java.io.InputStream implements ErrorNotifiable
InputStreamfor channels. Canreceivedata into its buffer for serving to readers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.schmizz.sshj.common.ErrorNotifiable
ErrorNotifiable.Util
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]bprivate CircularBuffer.PlainCircularBufferbufprivate Channelchanprivate booleaneofprivate SSHExceptionerrorprivate org.slf4j.Loggerlogprivate Transporttransprivate Window.Localwin
-
Constructor Summary
Constructors Constructor Description ChannelInputStream(Channel chan, Transport trans, Window.Local win)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()private voidcheckWindow()voidclose()voideof()voidnotifyError(SSHException error)Notifies this object of anerror.intread()intread(byte[] b, int off, int len)voidreceive(byte[] data, int offset, int len)java.lang.StringtoString()
-
-
-
Field Detail
-
log
private final org.slf4j.Logger log
-
chan
private final Channel chan
-
trans
private final Transport trans
-
win
private final Window.Local win
-
buf
private final CircularBuffer.PlainCircularBuffer buf
-
b
private final byte[] b
-
eof
private boolean eof
-
error
private SSHException error
-
-
Constructor Detail
-
ChannelInputStream
public ChannelInputStream(Channel chan, Transport trans, Window.Local win)
-
-
Method Detail
-
available
public int available()
- Overrides:
availablein classjava.io.InputStream
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream
-
eof
public void eof()
-
notifyError
public void notifyError(SSHException error)
Description copied from interface:ErrorNotifiableNotifies this object of anerror.- Specified by:
notifyErrorin interfaceErrorNotifiable
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
receive
public void receive(byte[] data, int offset, int len) throws SSHException- Throws:
SSHException
-
checkWindow
private void checkWindow() throws TransportException- Throws:
TransportException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-